<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Eigen: SparseMatrix.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
<!--  -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen</a>
   &#160;<span id="projectnumber">3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('SparseMatrix_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">SparseMatrix.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// This file is part of Eigen, a lightweight C++ template library</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// for linear algebra.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2008-2014 Gael Guennebaud &lt;gael.guennebaud@inria.fr&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This Source Code Form is subject to the terms of the Mozilla</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// Public License v. 2.0. If a copy of the MPL was not distributed</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef EIGEN_SPARSEMATRIX_H</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#define EIGEN_SPARSEMATRIX_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;./InternalHeaderCheck.h&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceEigen.html">Eigen</a> { </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">namespace </span>internal {</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar_, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">struct </span>traits&lt;SparseMatrix&lt;Scalar_, Options_, StorageIndex_&gt; &gt;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;{</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <span class="keyword">typedef</span> Scalar_ Scalar;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;  <span class="keyword">typedef</span> StorageIndex_ StorageIndex;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;  <span class="keyword">typedef</span> Sparse StorageKind;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  <span class="keyword">typedef</span> MatrixXpr XprKind;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;  <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    RowsAtCompileTime = <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a>,</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    ColsAtCompileTime = <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a>,</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    MaxRowsAtCompileTime = <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a>,</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    MaxColsAtCompileTime = <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a>,</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    Flags = Options_ | NestByRefBit | <a class="code" href="group__flags.html#gae2c323957f20dfdc6cb8f44428eaec1a">LvalueBit</a> | <a class="code" href="group__flags.html#gaed0244284da47a2b8661261431173caf">CompressedAccessBit</a>,</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    SupportedAccessPatterns = InnerRandomAccessPattern</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  };</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;};</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar_, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_, <span class="keywordtype">int</span> DiagIndex&gt;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keyword">struct </span>traits&lt;Diagonal&lt;SparseMatrix&lt;Scalar_, Options_, StorageIndex_&gt;, DiagIndex&gt; &gt;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;{</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="keyword">typedef</span> SparseMatrix&lt;Scalar_, Options_, StorageIndex_&gt; MatrixType;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> ref_selector&lt;MatrixType&gt;::type MatrixTypeNested;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <span class="keyword">typedef</span> std::remove_reference_t&lt;MatrixTypeNested&gt; MatrixTypeNested_;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <span class="keyword">typedef</span> Scalar_ Scalar;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="keyword">typedef</span> Dense StorageKind;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  <span class="keyword">typedef</span> StorageIndex_ StorageIndex;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  <span class="keyword">typedef</span> MatrixXpr XprKind;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    RowsAtCompileTime = <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a>,</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    ColsAtCompileTime = 1,</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    MaxRowsAtCompileTime = <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a>,</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    MaxColsAtCompileTime = 1,</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    Flags = <a class="code" href="group__flags.html#gae2c323957f20dfdc6cb8f44428eaec1a">LvalueBit</a></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;  };</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;};</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar_, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_, <span class="keywordtype">int</span> DiagIndex&gt;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="keyword">struct </span>traits&lt;Diagonal&lt;const SparseMatrix&lt;Scalar_, Options_, StorageIndex_&gt;, DiagIndex&gt; &gt;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160; : <span class="keyword">public</span> traits&lt;Diagonal&lt;SparseMatrix&lt;Scalar_, Options_, StorageIndex_&gt;, DiagIndex&gt; &gt;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;{</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    Flags = 0</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  };</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;};</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160; </div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;} <span class="comment">// end namespace internal</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar_, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html">   98</a></span>&#160;<span class="keyword">class </span><a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix</a></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  : <span class="keyword">public</span> <a class="code" href="classEigen_1_1SparseCompressedBase.html">SparseCompressedBase</a>&lt;SparseMatrix&lt;Scalar_, Options_, StorageIndex_&gt; &gt;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;{</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="classEigen_1_1SparseCompressedBase.html">SparseCompressedBase&lt;SparseMatrix&gt;</a> <a class="code" href="classEigen_1_1SparseCompressedBase.html">Base</a>;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keyword">using</span> Base::convert_index;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classEigen_1_1SparseVector.html">SparseVector</a>&lt;Scalar_,0,StorageIndex_&gt;;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span>, <span class="keyword">typename</span>, <span class="keyword">typename</span>, <span class="keyword">typename</span>, <span class="keyword">typename</span>&gt;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">friend</span> <span class="keyword">struct </span>internal::Assignment;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keyword">using</span> <a class="code" href="classEigen_1_1SparseCompressedBase.html#a837934b33a80fe996ff20500373d3a61">Base::isCompressed</a>;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keyword">using</span> <a class="code" href="classEigen_1_1SparseCompressedBase.html#a03de8b3da2c142ce8698a76123b3e7d3">Base::nonZeros</a>;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    EIGEN_SPARSE_PUBLIC_INTERFACE(<a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix</a>)</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keyword">using</span> Base::operator+=;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keyword">using</span> Base::operator-=;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="classEigen_1_1Map.html">Eigen::Map&lt;SparseMatrix&lt;Scalar,Flags,StorageIndex&gt;</a>&gt; <a class="code" href="classEigen_1_1Map.html">Map</a>;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="classEigen_1_1Diagonal.html">Diagonal&lt;SparseMatrix&gt;</a> <a class="code" href="classEigen_1_1Diagonal.html">DiagonalReturnType</a>;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="classEigen_1_1Diagonal.html">Diagonal&lt;const SparseMatrix&gt;</a> <a class="code" href="classEigen_1_1Diagonal.html">ConstDiagonalReturnType</a>;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> Base::InnerIterator InnerIterator;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> Base::ReverseInnerIterator ReverseInnerIterator;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keyword">using</span> Base::IsRowMajor;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keyword">typedef</span> internal::CompressedStorage&lt;Scalar,StorageIndex&gt; Storage;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;      Options = Options_</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    };</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classEigen_1_1Matrix.html">Base::IndexVector</a> <a class="code" href="classEigen_1_1Matrix.html">IndexVector</a>;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classEigen_1_1Matrix.html">Base::ScalarVector</a> <a class="code" href="classEigen_1_1Matrix.html">ScalarVector</a>;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix</a>&lt;Scalar,(<a class="code" href="classEigen_1_1SparseMatrixBase.html#aa87f0d5bd3103b0d3668351573ee37caa2af043b36fe9e08df0107cf6de496165">Flags</a>&amp;~<a class="code" href="group__flags.html#gae4f56c2a60bbe4bd2e44c5b19cbe8762">RowMajorBit</a>)|(IsRowMajor?<a class="code" href="group__flags.html#gae4f56c2a60bbe4bd2e44c5b19cbe8762">RowMajorBit</a>:0),<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>&gt; <a class="code" href="classEigen_1_1SparseMatrix.html">TransposedSparseMatrix</a>;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160; </div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> m_outerSize;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> m_innerSize;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* m_outerIndex;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* m_innerNonZeros;     <span class="comment">// optional, if null then the data is compressed</span></div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    Storage m_data;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    </div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">  140</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> IsRowMajor ? m_outerSize : m_innerSize; }</div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">  142</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> IsRowMajor ? m_innerSize : m_outerSize; }</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#aa6411a0a909423d2d843a2e7d8b8e4e7">  145</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#aa6411a0a909423d2d843a2e7d8b8e4e7">innerSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_innerSize; }</div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a47c7cdf3c713ea69d08387aaf78e0c53">  147</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a47c7cdf3c713ea69d08387aaf78e0c53">outerSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_outerSize; }</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    </div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a6ed99bab9d4f142c629f69a93a2d1efb">  152</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> Scalar* <a class="code" href="classEigen_1_1SparseMatrix.html#a6ed99bab9d4f142c629f69a93a2d1efb">valuePtr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_data.valuePtr(); }</div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a5e9513f7d7336a698a47ff3135d6d555">  156</a></span>&#160;    <span class="keyword">inline</span> Scalar* <a class="code" href="classEigen_1_1SparseMatrix.html#a5e9513f7d7336a698a47ff3135d6d555">valuePtr</a>() { <span class="keywordflow">return</span> m_data.valuePtr(); }</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ade3e26297390865d80a09d1ce06cc916">  161</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* <a class="code" href="classEigen_1_1SparseMatrix.html#ade3e26297390865d80a09d1ce06cc916">innerIndexPtr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_data.indexPtr(); }</div>
<div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a0f927d1e7251a78585b12bf451423d4e">  165</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* <a class="code" href="classEigen_1_1SparseMatrix.html#a0f927d1e7251a78585b12bf451423d4e">innerIndexPtr</a>() { <span class="keywordflow">return</span> m_data.indexPtr(); }</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ad2d1a4d9033c2bc0917ea09cdc5c700c">  170</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* <a class="code" href="classEigen_1_1SparseMatrix.html#ad2d1a4d9033c2bc0917ea09cdc5c700c">outerIndexPtr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_outerIndex; }</div>
<div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a6de5655e0e36dfefd9812d65f48092f9">  174</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* <a class="code" href="classEigen_1_1SparseMatrix.html#a6de5655e0e36dfefd9812d65f48092f9">outerIndexPtr</a>() { <span class="keywordflow">return</span> m_outerIndex; }</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a62ba20726a10c2c9d095aed024297a2a">  179</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* <a class="code" href="classEigen_1_1SparseMatrix.html#a62ba20726a10c2c9d095aed024297a2a">innerNonZeroPtr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_innerNonZeros; }</div>
<div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a0fa5da473fe96a8ae7fae6f3ca2d5b62">  183</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* <a class="code" href="classEigen_1_1SparseMatrix.html#a0fa5da473fe96a8ae7fae6f3ca2d5b62">innerNonZeroPtr</a>() { <span class="keywordflow">return</span> m_innerNonZeros; }</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    <span class="keyword">inline</span> Storage&amp; data() { <span class="keywordflow">return</span> m_data; }</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> Storage&amp; data()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_data; }</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160; </div>
<div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a05c9adc323553ed53726acae06fc4c18">  192</a></span>&#160;    <span class="keyword">inline</span> Scalar <a class="code" href="classEigen_1_1SparseMatrix.html#a05c9adc323553ed53726acae06fc4c18">coeff</a>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> row, <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> col)<span class="keyword"> const</span></div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;<span class="keyword">    </span>{</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;      eigen_assert(row&gt;=0 &amp;&amp; row&lt;<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>() &amp;&amp; col&gt;=0 &amp;&amp; col&lt;<a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>());</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;      </div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> outer = IsRowMajor ? row : col;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> inner = IsRowMajor ? col : row;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a> = m_innerNonZeros ? m_outerIndex[outer] + m_innerNonZeros[outer] : m_outerIndex[outer+1];</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;      <span class="keywordflow">return</span> m_data.atInRange(m_outerIndex[outer], <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>, <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>(inner));</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    }</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160; </div>
<div class="line"><a name="l00210"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a6e4f970149f1cbab1eecc2a04c291fb1">  210</a></span>&#160;    <span class="keyword">inline</span> Scalar&amp; <a class="code" href="classEigen_1_1SparseMatrix.html#a6e4f970149f1cbab1eecc2a04c291fb1">coeffRef</a>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> row, <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> col)</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    {</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;      eigen_assert(row&gt;=0 &amp;&amp; row&lt;<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>() &amp;&amp; col&gt;=0 &amp;&amp; col&lt;<a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>());</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;      </div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> outer = IsRowMajor ? row : col;</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> inner = IsRowMajor ? col : row;</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160; </div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> start = m_outerIndex[outer];</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a> = m_innerNonZeros ? m_outerIndex[outer] + m_innerNonZeros[outer] : m_outerIndex[outer+1];</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;      eigen_assert(<a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>&gt;=start &amp;&amp; <span class="stringliteral">&quot;you probably called coeffRef on a non finalized matrix&quot;</span>);</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;      <span class="keywordflow">if</span>(<a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>&lt;=start)</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ae2d8f72ff86a300b76f9edd67df8d8fd">insert</a>(row,col);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> p = m_data.searchLowerIndex(start,<a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>-1,<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>(inner));</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;      <span class="keywordflow">if</span>((p&lt;<a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>) &amp;&amp; (m_data.index(p)==inner))</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;        <span class="keywordflow">return</span> m_data.value(p);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;      <span class="keywordflow">else</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ae2d8f72ff86a300b76f9edd67df8d8fd">insert</a>(row,col);</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    }</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ae2d8f72ff86a300b76f9edd67df8d8fd">  244</a></span>&#160;    Scalar&amp; <a class="code" href="classEigen_1_1SparseMatrix.html#ae2d8f72ff86a300b76f9edd67df8d8fd">insert</a>(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> row, <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> col);</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160; </div>
<div class="line"><a name="l00255"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a2feb71dd2ed222057a77ff92b736badc">  255</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a2feb71dd2ed222057a77ff92b736badc">setZero</a>()</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    {</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;      m_data.clear();</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;      std::fill_n(m_outerIndex, m_outerSize + 1, <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>(0));</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;      <span class="keywordflow">if</span>(m_innerNonZeros) {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        std::fill_n(m_innerNonZeros, m_outerSize, <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>(0));</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;      }</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    }</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160; </div>
<div class="line"><a name="l00267"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ad9e36e669468663012b77bf1bff8cc4f">  267</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ad9e36e669468663012b77bf1bff8cc4f">reserve</a>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> reserveSize)</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    {</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;      eigen_assert(<a class="code" href="classEigen_1_1SparseMatrix.html#a837934b33a80fe996ff20500373d3a61">isCompressed</a>() &amp;&amp; <span class="stringliteral">&quot;This function does not make sense in non compressed mode.&quot;</span>);</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;      m_data.reserve(reserveSize);</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    }</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    </div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;<span class="preprocessor">    #ifdef EIGEN_PARSED_BY_DOXYGEN</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> SizesType&gt;</div>
<div class="line"><a name="l00287"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ae344017e0e191f452ee84fa6a384ea7a">  287</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ae344017e0e191f452ee84fa6a384ea7a">reserve</a>(<span class="keyword">const</span> SizesType&amp; reserveSizes);</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;<span class="preprocessor">    #else</span></div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> SizesType&gt;</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ad9e36e669468663012b77bf1bff8cc4f">reserve</a>(<span class="keyword">const</span> SizesType&amp; reserveSizes, <span class="keyword">const</span> <span class="keyword">typename</span> SizesType::value_type&amp; enableif =</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;        <span class="keyword">typename</span> SizesType::value_type())</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    {</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;      EIGEN_UNUSED_VARIABLE(enableif);</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;      reserveInnerVectors(reserveSizes);</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    }</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;<span class="preprocessor">    #endif </span><span class="comment">// EIGEN_PARSED_BY_DOXYGEN</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> SizesType&gt;</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> reserveInnerVectors(<span class="keyword">const</span> SizesType&amp; reserveSizes)</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    {</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;      <span class="keywordflow">if</span>(<a class="code" href="classEigen_1_1SparseMatrix.html#a837934b33a80fe996ff20500373d3a61">isCompressed</a>())</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;      {</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;        <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> totalReserveSize = 0;</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;        <span class="comment">// turn the matrix into non-compressed mode</span></div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        m_innerNonZeros = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::malloc(m_outerSize * <span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;        <span class="keywordflow">if</span> (!m_innerNonZeros) internal::throw_std_bad_alloc();</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;        </div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;        <span class="comment">// temporarily use m_innerSizes to hold the new starting points.</span></div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* newOuterIndex = m_innerNonZeros;</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;        </div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> count = 0;</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j=0; j&lt;m_outerSize; ++j)</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;        {</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;          newOuterIndex[j] = count;</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;          count += reserveSizes[j] + (m_outerIndex[j+1]-m_outerIndex[j]);</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;          totalReserveSize += reserveSizes[j];</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;        }</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;        m_data.reserve(totalReserveSize);</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> previousOuterIndex = m_outerIndex[m_outerSize];</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> j=m_outerSize-1; j&gt;=0; --j)</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;        {</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;          <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> innerNNZ = previousOuterIndex - m_outerIndex[j];</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;          <span class="keywordflow">for</span>(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> i=innerNNZ-1; i&gt;=0; --i)</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;          {</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;            m_data.index(newOuterIndex[j]+i) = m_data.index(m_outerIndex[j]+i);</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;            m_data.value(newOuterIndex[j]+i) = m_data.value(m_outerIndex[j]+i);</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;          }</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;          previousOuterIndex = m_outerIndex[j];</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;          m_outerIndex[j] = newOuterIndex[j];</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;          m_innerNonZeros[j] = innerNNZ;</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        }</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;        <span class="keywordflow">if</span>(m_outerSize&gt;0)</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;          m_outerIndex[m_outerSize] = m_outerIndex[m_outerSize-1] + m_innerNonZeros[m_outerSize-1] + reserveSizes[m_outerSize-1];</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;        </div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;        m_data.resize(m_outerIndex[m_outerSize]);</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;      }</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;      <span class="keywordflow">else</span></div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;      {</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>* newOuterIndex = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::malloc((m_outerSize+1)*<span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;        <span class="keywordflow">if</span> (!newOuterIndex) internal::throw_std_bad_alloc();</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;        </div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> count = 0;</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> j=0; j&lt;m_outerSize; ++j)</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;        {</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;          newOuterIndex[j] = count;</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;          <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> alreadyReserved = (m_outerIndex[j+1]-m_outerIndex[j]) - m_innerNonZeros[j];</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;          <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> toReserve = std::max&lt;StorageIndex&gt;(reserveSizes[j], alreadyReserved);</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;          count += toReserve + m_innerNonZeros[j];</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;        }</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;        newOuterIndex[m_outerSize] = count;</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;        </div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;        m_data.resize(count);</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> j=m_outerSize-1; j&gt;=0; --j)</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;        {</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;          <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> offset = newOuterIndex[j] - m_outerIndex[j];</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;          <span class="keywordflow">if</span>(offset&gt;0)</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;          {</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;            <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> innerNNZ = m_innerNonZeros[j];</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;            <span class="keywordflow">for</span>(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> i=innerNNZ-1; i&gt;=0; --i)</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;            {</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;              m_data.index(newOuterIndex[j]+i) = m_data.index(m_outerIndex[j]+i);</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;              m_data.value(newOuterIndex[j]+i) = m_data.value(m_outerIndex[j]+i);</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;            }</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;          }</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;        }</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;        </div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;        std::swap(m_outerIndex, newOuterIndex);</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;        std::free(newOuterIndex);</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;      }</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;      </div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    }</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160; </div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;    <span class="comment">//--- low level purely coherent filling ---</span></div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160; </div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;    <span class="keyword">inline</span> Scalar&amp; insertBack(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> row, <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> col)</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;    {</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;      <span class="keywordflow">return</span> insertBackByOuterInner(IsRowMajor?row:col, IsRowMajor?col:row);</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;    }</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160; </div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;    <span class="keyword">inline</span> Scalar&amp; insertBackByOuterInner(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> outer, <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> inner)</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;    {</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;      eigen_assert(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a>(m_outerIndex[outer+1]) == m_data.size() &amp;&amp; <span class="stringliteral">&quot;Invalid ordered insertion (invalid outer index)&quot;</span>);</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;      eigen_assert( (m_outerIndex[outer+1]-m_outerIndex[outer]==0 || m_data.index(m_data.size()-1)&lt;inner) &amp;&amp; <span class="stringliteral">&quot;Invalid ordered insertion (invalid inner index)&quot;</span>);</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;      <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> p = m_outerIndex[outer+1];</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;      ++m_outerIndex[outer+1];</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;      m_data.append(Scalar(0), inner);</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;      <span class="keywordflow">return</span> m_data.value(p);</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    }</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160; </div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;    <span class="keyword">inline</span> Scalar&amp; insertBackByOuterInnerUnordered(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> outer, <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> inner)</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;    {</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;      <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> p = m_outerIndex[outer+1];</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;      ++m_outerIndex[outer+1];</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;      m_data.append(Scalar(0), inner);</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;      <span class="keywordflow">return</span> m_data.value(p);</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;    }</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160; </div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> startVec(<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> outer)</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;    {</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;      eigen_assert(m_outerIndex[outer]==<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a>(m_data.size()) &amp;&amp; <span class="stringliteral">&quot;You must call startVec for each inner vector sequentially&quot;</span>);</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;      eigen_assert(m_outerIndex[outer+1]==0 &amp;&amp; <span class="stringliteral">&quot;You must call startVec for each inner vector sequentially&quot;</span>);</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;      m_outerIndex[outer+1] = m_outerIndex[outer];</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    }</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160; </div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> finalize()</div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;    {</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;      <span class="keywordflow">if</span>(<a class="code" href="classEigen_1_1SparseMatrix.html#a837934b33a80fe996ff20500373d3a61">isCompressed</a>())</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;      {</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> <a class="code" href="classEigen_1_1SparseMatrixBase.html#a124bc57921775eb9aa2dfd9727e23472">size</a> = internal::convert_index&lt;StorageIndex&gt;(m_data.size());</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;        <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> i = m_outerSize;</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;        <span class="comment">// find the last filled column</span></div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;        <span class="keywordflow">while</span> (i&gt;=0 &amp;&amp; m_outerIndex[i]==0)</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;          --i;</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;        ++i;</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;        <span class="keywordflow">while</span> (i&lt;=m_outerSize)</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;        {</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;          m_outerIndex[i] = <a class="code" href="classEigen_1_1SparseMatrixBase.html#a124bc57921775eb9aa2dfd9727e23472">size</a>;</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;          ++i;</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;        }</div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;      }</div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;    }</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160; </div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;    <span class="comment">//---</span></div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160; </div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> InputIterators&gt;</div>
<div class="line"><a name="l00446"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a8f09e3597f37aa8861599260af6a53e0">  446</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a8f09e3597f37aa8861599260af6a53e0">setFromTriplets</a>(<span class="keyword">const</span> InputIterators&amp; begin, <span class="keyword">const</span> InputIterators&amp; <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>);</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160; </div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> InputIterators,<span class="keyword">typename</span> DupFunctor&gt;</div>
<div class="line"><a name="l00449"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a3e8c96b7dd72d03f14b5cf40f5005d55">  449</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a3e8c96b7dd72d03f14b5cf40f5005d55">setFromTriplets</a>(<span class="keyword">const</span> InputIterators&amp; begin, <span class="keyword">const</span> InputIterators&amp; <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>, DupFunctor dup_func);</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160; </div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    <span class="keywordtype">void</span> sumupDuplicates() { collapseDuplicates(internal::scalar_sum_op&lt;Scalar,Scalar&gt;()); }</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160; </div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DupFunctor&gt;</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;    <span class="keywordtype">void</span> collapseDuplicates(DupFunctor dup_func = DupFunctor());</div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160; </div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;    <span class="comment">//---</span></div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;    </div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;    Scalar&amp; insertByOuterInner(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j, <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i)</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;    {</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ae2d8f72ff86a300b76f9edd67df8d8fd">insert</a>(IsRowMajor ? j : i, IsRowMajor ? i : j);</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;    }</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160; </div>
<div class="line"><a name="l00467"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a6400e6e733a7131f9b776d6386d2ed89">  467</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a6400e6e733a7131f9b776d6386d2ed89">makeCompressed</a>()</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;    {</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;      <span class="keywordflow">if</span>(<a class="code" href="classEigen_1_1SparseMatrix.html#a837934b33a80fe996ff20500373d3a61">isCompressed</a>())</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;      </div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;      eigen_internal_assert(m_outerIndex!=0 &amp;&amp; m_outerSize&gt;0);</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;      </div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> oldStart = m_outerIndex[1];</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;      m_outerIndex[1] = m_innerNonZeros[0];</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;      <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j=1; j&lt;m_outerSize; ++j)</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;      {</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;        <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> nextOldStart = m_outerIndex[j+1];</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;        <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> offset = oldStart - m_outerIndex[j];</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;        <span class="keywordflow">if</span>(offset&gt;0)</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;        {</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;          <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> k=0; k&lt;m_innerNonZeros[j]; ++k)</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;          {</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;            m_data.index(m_outerIndex[j]+k) = m_data.index(oldStart+k);</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;            m_data.value(m_outerIndex[j]+k) = m_data.value(oldStart+k);</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;          }</div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;        }</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;        m_outerIndex[j+1] = m_outerIndex[j] + m_innerNonZeros[j];</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;        oldStart = nextOldStart;</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;      }</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;      std::free(m_innerNonZeros);</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;      m_innerNonZeros = 0;</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;      m_data.resize(m_outerIndex[m_outerSize]);</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;      m_data.squeeze();</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;    }</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160; </div>
<div class="line"><a name="l00498"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a542c2a877dcffbd48248b43d3eaf670f">  498</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a542c2a877dcffbd48248b43d3eaf670f">uncompress</a>()</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;    {</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;      <span class="keywordflow">if</span>(m_innerNonZeros != 0)</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;        <span class="keywordflow">return</span>; </div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;      m_innerNonZeros = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::malloc(m_outerSize * <span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;      <span class="keywordflow">for</span> (<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i = 0; i &lt; m_outerSize; i++)</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;      {</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;        m_innerNonZeros[i] = m_outerIndex[i+1] - m_outerIndex[i]; </div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;      }</div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;    }</div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160; </div>
<div class="line"><a name="l00510"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ab4b7ffe0c08f653f5c34b02b9b12e6bf">  510</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ab4b7ffe0c08f653f5c34b02b9b12e6bf">prune</a>(<span class="keyword">const</span> Scalar&amp; reference, <span class="keyword">const</span> RealScalar&amp; epsilon = <a class="code" href="structEigen_1_1NumTraits.html">NumTraits&lt;RealScalar&gt;::dummy_precision</a>())</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;    {</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrix.html#ab4b7ffe0c08f653f5c34b02b9b12e6bf">prune</a>(default_prunning_func(reference,epsilon));</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;    }</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;    </div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeepFunc&gt;</div>
<div class="line"><a name="l00523"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#aca3916ec112e13c513380b47fad7954b">  523</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#aca3916ec112e13c513380b47fad7954b">prune</a>(<span class="keyword">const</span> KeepFunc&amp; keep = KeepFunc())</div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;    {</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;      <span class="comment">// TODO optimize the uncompressed mode to avoid moving and allocating the data twice</span></div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrix.html#a6400e6e733a7131f9b776d6386d2ed89">makeCompressed</a>();</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160; </div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> k = 0;</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;      <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j=0; j&lt;m_outerSize; ++j)</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;      {</div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;        <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> previousStart = m_outerIndex[j];</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;        m_outerIndex[j] = k;</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;        <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a> = m_outerIndex[j+1];</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i=previousStart; i&lt;<a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>; ++i)</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;        {</div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;          <span class="keywordflow">if</span>(keep(IsRowMajor?j:m_data.index(i), IsRowMajor?m_data.index(i):j, m_data.value(i)))</div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;          {</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;            m_data.value(k) = m_data.value(i);</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;            m_data.index(k) = m_data.index(i);</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;            ++k;</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;          }</div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;        }</div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;      }</div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;      m_outerIndex[m_outerSize] = k;</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;      m_data.resize(k,0);</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;    }</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160; </div>
<div class="line"><a name="l00556"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ab0e43ac03eb34e451e0f16e97ea2afda">  556</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ab0e43ac03eb34e451e0f16e97ea2afda">conservativeResize</a>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>, <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>) </div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;    {</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;      <span class="comment">// No change</span></div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;      <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>() == rows &amp;&amp; this-&gt;<a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>() == cols) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;      </div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;      <span class="comment">// If one dimension is null, then there is nothing to be preserved</span></div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;      <span class="keywordflow">if</span>(<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>==0 || <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>==0) <span class="keywordflow">return</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a835ae5b304ddbb187eac25d5850b2ced">resize</a>(<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>,<a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>);</div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160; </div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> innerChange = IsRowMajor ? <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a> - this-&gt;<a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>() : rows - this-&gt;<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>();</div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> outerChange = IsRowMajor ? <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a> - this-&gt;<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>() : cols - this-&gt;<a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>();</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> newInnerSize = convert_index(IsRowMajor ? <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a> : <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>);</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160; </div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;      <span class="comment">// Deals with inner non zeros</span></div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;      <span class="keywordflow">if</span> (m_innerNonZeros)</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;      {</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;        <span class="comment">// Resize m_innerNonZeros</span></div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> *newInnerNonZeros = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::realloc(m_innerNonZeros, (m_outerSize + outerChange) * <span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;        <span class="keywordflow">if</span> (!newInnerNonZeros) internal::throw_std_bad_alloc();</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;        m_innerNonZeros = newInnerNonZeros;</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;        </div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i=m_outerSize; i&lt;m_outerSize+outerChange; i++)          </div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;          m_innerNonZeros[i] = 0;</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;      } </div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;      <span class="keywordflow">else</span> <span class="keywordflow">if</span> (innerChange &lt; 0) </div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;      {</div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;        <span class="comment">// Inner size decreased: allocate a new m_innerNonZeros</span></div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;        m_innerNonZeros = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::malloc((m_outerSize + outerChange) * <span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;        <span class="keywordflow">if</span> (!m_innerNonZeros) internal::throw_std_bad_alloc();</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i = 0; i &lt; m_outerSize + (std::min)(outerChange, <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a>(0)); i++)</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;          m_innerNonZeros[i] = m_outerIndex[i+1] - m_outerIndex[i];</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i = m_outerSize; i &lt; m_outerSize + outerChange; i++)</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;          m_innerNonZeros[i] = 0;</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;      }</div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;      </div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;      <span class="comment">// Change the m_innerNonZeros in case of a decrease of inner size</span></div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;      <span class="keywordflow">if</span> (m_innerNonZeros &amp;&amp; innerChange &lt; 0)</div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;      {</div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i = 0; i &lt; m_outerSize + (std::min)(outerChange, <a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a>(0)); i++)</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;        {</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;          <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> &amp;n = m_innerNonZeros[i];</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;          <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> start = m_outerIndex[i];</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;          <span class="keywordflow">while</span> (n &gt; 0 &amp;&amp; m_data.index(start+n-1) &gt;= newInnerSize) --n; </div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;        }</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;      }</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;      </div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;      m_innerSize = newInnerSize;</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160; </div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;      <span class="comment">// Re-allocate outer index structure if necessary</span></div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;      <span class="keywordflow">if</span> (outerChange == 0)</div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;          </div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> *newOuterIndex = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::realloc(m_outerIndex, (m_outerSize + outerChange + 1) * <span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;      <span class="keywordflow">if</span> (!newOuterIndex) internal::throw_std_bad_alloc();</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;      m_outerIndex = newOuterIndex;</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;      <span class="keywordflow">if</span> (outerChange &gt; 0)</div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;      {</div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> lastIdx = m_outerSize == 0 ? 0 : m_outerIndex[m_outerSize];</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;        <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i=m_outerSize; i&lt;m_outerSize+outerChange+1; i++)          </div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;          m_outerIndex[i] = lastIdx; </div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;      }</div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;      m_outerSize += outerChange;</div>
<div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;    }</div>
<div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;    </div>
<div class="line"><a name="l00626"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a835ae5b304ddbb187eac25d5850b2ced">  626</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a835ae5b304ddbb187eac25d5850b2ced">resize</a>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>, <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>)</div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;    {</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a47c7cdf3c713ea69d08387aaf78e0c53">outerSize</a> = IsRowMajor ? <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a> : <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>;</div>
<div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;      m_innerSize = IsRowMajor ? <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a> : <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>;</div>
<div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;      m_data.clear();</div>
<div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;      <span class="keywordflow">if</span> (m_outerSize != <a class="code" href="classEigen_1_1SparseMatrix.html#a47c7cdf3c713ea69d08387aaf78e0c53">outerSize</a> || m_outerSize==0)</div>
<div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;      {</div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;        std::free(m_outerIndex);</div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;        m_outerIndex = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::malloc((<a class="code" href="classEigen_1_1SparseMatrix.html#a47c7cdf3c713ea69d08387aaf78e0c53">outerSize</a> + 1) * <span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;        <span class="keywordflow">if</span> (!m_outerIndex) internal::throw_std_bad_alloc();</div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;        </div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;        m_outerSize = <a class="code" href="classEigen_1_1SparseMatrix.html#a47c7cdf3c713ea69d08387aaf78e0c53">outerSize</a>;</div>
<div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;      }</div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;      <span class="keywordflow">if</span>(m_innerNonZeros)</div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;      {</div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;        std::free(m_innerNonZeros);</div>
<div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;        m_innerNonZeros = 0;</div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;      }</div>
<div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;      std::fill_n(m_outerIndex, m_outerSize + 1, <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>(0));</div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;    }</div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160; </div>
<div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;    <span class="keywordtype">void</span> resizeNonZeros(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrixBase.html#a124bc57921775eb9aa2dfd9727e23472">size</a>)</div>
<div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;    {</div>
<div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160;      m_data.resize(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a124bc57921775eb9aa2dfd9727e23472">size</a>);</div>
<div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160;    }</div>
<div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160; </div>
<div class="line"><a name="l00655"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a20301b7b657f0948d6a6da68509fb4da">  655</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="classEigen_1_1Diagonal.html">ConstDiagonalReturnType</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a20301b7b657f0948d6a6da68509fb4da">diagonal</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classEigen_1_1Diagonal.html">ConstDiagonalReturnType</a>(*<span class="keyword">this</span>); }</div>
<div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;    </div>
<div class="line"><a name="l00661"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ae6f4db56c76e4d374eb8507fbef5bdb5">  661</a></span>&#160;    <a class="code" href="classEigen_1_1Diagonal.html">DiagonalReturnType</a> <a class="code" href="classEigen_1_1SparseMatrix.html#ae6f4db56c76e4d374eb8507fbef5bdb5">diagonal</a>() { <span class="keywordflow">return</span> <a class="code" href="classEigen_1_1Diagonal.html">DiagonalReturnType</a>(*<span class="keyword">this</span>); }</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160; </div>
<div class="line"><a name="l00664"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a4f28e83ea504f0d8ee76c4b8701939d6">  664</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a4f28e83ea504f0d8ee76c4b8701939d6">SparseMatrix</a>()</div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;      : m_outerSize(-1), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0)</div>
<div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;    {</div>
<div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrix.html#a835ae5b304ddbb187eac25d5850b2ced">resize</a>(0, 0);</div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;    }</div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160; </div>
<div class="line"><a name="l00671"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#aa647b5f0462b9986e3c907e9ca7c5984">  671</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html#aa647b5f0462b9986e3c907e9ca7c5984">SparseMatrix</a>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>, <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>)</div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;      : m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0)</div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;    {</div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrix.html#a835ae5b304ddbb187eac25d5850b2ced">resize</a>(<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>, <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>);</div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;    }</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160; </div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;</div>
<div class="line"><a name="l00679"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ac4a6307cd6ba6b4ee7124d590d3120bf">  679</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ac4a6307cd6ba6b4ee7124d590d3120bf">SparseMatrix</a>(<span class="keyword">const</span> <a class="code" href="classEigen_1_1SparseMatrixBase.html">SparseMatrixBase&lt;OtherDerived&gt;</a>&amp; other)</div>
<div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;      : m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0)</div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;    {</div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;      EIGEN_STATIC_ASSERT((internal::is_same&lt;Scalar, typename OtherDerived::Scalar&gt;::value),</div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;        YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)</div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;      <span class="keyword">const</span> <span class="keywordtype">bool</span> needToTranspose = (<a class="code" href="classEigen_1_1SparseMatrixBase.html#aa87f0d5bd3103b0d3668351573ee37caa2af043b36fe9e08df0107cf6de496165">Flags</a> &amp; <a class="code" href="group__flags.html#gae4f56c2a60bbe4bd2e44c5b19cbe8762">RowMajorBit</a>) != (internal::evaluator&lt;OtherDerived&gt;::Flags &amp; <a class="code" href="group__flags.html#gae4f56c2a60bbe4bd2e44c5b19cbe8762">RowMajorBit</a>);</div>
<div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;      <span class="keywordflow">if</span> (needToTranspose)</div>
<div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;        *<span class="keyword">this</span> = other.<a class="code" href="structEigen_1_1EigenBase.html#a1fbabe7f12bcbfba3b9a448b1f5e46fa">derived</a>();</div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;      <span class="keywordflow">else</span></div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;      {</div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;<span class="preprocessor">        #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN</span></div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;          EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN</div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;<span class="preprocessor">        #endif</span></div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;        internal::call_assignment_no_alias(*<span class="keyword">this</span>, other.<a class="code" href="structEigen_1_1EigenBase.html#a1fbabe7f12bcbfba3b9a448b1f5e46fa">derived</a>());</div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;      }</div>
<div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;    }</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160; </div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> UpLo&gt;</div>
<div class="line"><a name="l00698"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a794f49fa972d5d39fc81c0925aae1513">  698</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a794f49fa972d5d39fc81c0925aae1513">SparseMatrix</a>(<span class="keyword">const</span> <a class="code" href="classEigen_1_1SparseSelfAdjointView.html">SparseSelfAdjointView&lt;OtherDerived, UpLo&gt;</a>&amp; other)</div>
<div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;      : m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0)</div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;    {</div>
<div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;      Base::operator=(other);</div>
<div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;    }</div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160; </div>
<div class="line"><a name="l00705"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a85ce452dd42db3db4e262e955f7820aa">  705</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a85ce452dd42db3db4e262e955f7820aa">SparseMatrix</a>(<span class="keyword">const</span> <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix</a>&amp; other)</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;      : <a class="code" href="classEigen_1_1SparseCompressedBase.html">Base</a>(), m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0)</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;    {</div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;      *<span class="keyword">this</span> = other.<a class="code" href="structEigen_1_1EigenBase.html#a1fbabe7f12bcbfba3b9a448b1f5e46fa">derived</a>();</div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;    }</div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160; </div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;</div>
<div class="line"><a name="l00713"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a394987faa818eb6a0a5c9f92c3740f1a">  713</a></span>&#160;    <a class="code" href="classEigen_1_1SparseMatrix.html#a394987faa818eb6a0a5c9f92c3740f1a">SparseMatrix</a>(<span class="keyword">const</span> ReturnByValue&lt;OtherDerived&gt;&amp; other)</div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;      : <a class="code" href="classEigen_1_1SparseCompressedBase.html">Base</a>(), m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0)</div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;    {</div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;      initAssignment(other);</div>
<div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;      other.evalTo(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;    }</div>
<div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160; </div>
<div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;</div>
<div class="line"><a name="l00722"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a9c8a247192285453d402becafdd106c4">  722</a></span>&#160;    <span class="keyword">explicit</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a9c8a247192285453d402becafdd106c4">SparseMatrix</a>(<span class="keyword">const</span> DiagonalBase&lt;OtherDerived&gt;&amp; other)</div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;      : <a class="code" href="classEigen_1_1SparseCompressedBase.html">Base</a>(), m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0)</div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;    {</div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;      *<span class="keyword">this</span> = other.<a class="code" href="structEigen_1_1EigenBase.html#a1fbabe7f12bcbfba3b9a448b1f5e46fa">derived</a>();</div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;    }</div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160; </div>
<div class="line"><a name="l00730"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a20eec45a940a4dd7edcacfa21468b328">  730</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a20eec45a940a4dd7edcacfa21468b328">swap</a>(<a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix</a>&amp; other)</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;    {</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;      <span class="comment">//EIGEN_DBG_SPARSE(std::cout &lt;&lt; &quot;SparseMatrix:: swap\n&quot;);</span></div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;      std::swap(m_outerIndex, other.m_outerIndex);</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;      std::swap(m_innerSize, other.m_innerSize);</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;      std::swap(m_outerSize, other.m_outerSize);</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;      std::swap(m_innerNonZeros, other.m_innerNonZeros);</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;      m_data.swap(other.m_data);</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;    }</div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160; </div>
<div class="line"><a name="l00742"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#aa4064cc1e3a4038cf09ff03af5a3ffb5">  742</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html#aa4064cc1e3a4038cf09ff03af5a3ffb5">setIdentity</a>()</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;    {</div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;      eigen_assert(<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>() == <a class="code" href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">cols</a>() &amp;&amp; <span class="stringliteral">&quot;ONLY FOR SQUARED MATRICES&quot;</span>);</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;      this-&gt;m_data.resize(<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>());</div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;      <a class="code" href="classEigen_1_1Map.html">Eigen::Map&lt;IndexVector&gt;</a>(this-&gt;m_data.indexPtr(), <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>()).setLinSpaced(0, <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>(<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>()-1));</div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;      <a class="code" href="classEigen_1_1Map.html">Eigen::Map&lt;ScalarVector&gt;</a>(this-&gt;m_data.valuePtr(), <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>()).setOnes();</div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;      <a class="code" href="classEigen_1_1Map.html">Eigen::Map&lt;IndexVector&gt;</a>(this-&gt;m_outerIndex, <a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>()+1).setLinSpaced(0, <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>(<a class="code" href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">rows</a>()));</div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;      std::free(m_innerNonZeros);</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;      m_innerNonZeros = 0;</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;    }</div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix</a>&amp; other)</div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;    {</div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;      <span class="keywordflow">if</span> (other.isRValue())</div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;      {</div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;        <a class="code" href="classEigen_1_1SparseMatrix.html#a20eec45a940a4dd7edcacfa21468b328">swap</a>(other.const_cast_derived());</div>
<div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;      }</div>
<div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;      <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<span class="keyword">this</span>!=&amp;other)</div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;      {</div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;<span class="preprocessor">        #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN</span></div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;          EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN</div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;<span class="preprocessor">        #endif</span></div>
<div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;        initAssignment(other);</div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;        <span class="keywordflow">if</span>(other.<a class="code" href="classEigen_1_1SparseMatrix.html#a837934b33a80fe996ff20500373d3a61">isCompressed</a>())</div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;        {</div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;          internal::smart_copy(other.m_outerIndex, other.m_outerIndex + m_outerSize + 1, m_outerIndex);</div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;          m_data = other.m_data;</div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;        }</div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;        {</div>
<div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;          Base::operator=(other);</div>
<div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;        }</div>
<div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;      }</div>
<div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;      <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;    }</div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160; </div>
<div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;<span class="preprocessor">#ifndef EIGEN_PARSED_BY_DOXYGEN</span></div>
<div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;</div>
<div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a4f28e83ea504f0d8ee76c4b8701939d6">SparseMatrix</a>&amp; operator=(<span class="keyword">const</span> EigenBase&lt;OtherDerived&gt;&amp; other)</div>
<div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;    { <span class="keywordflow">return</span> Base::operator=(other.derived()); }</div>
<div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160; </div>
<div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Lhs, <span class="keyword">typename</span> Rhs&gt;</div>
<div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a4f28e83ea504f0d8ee76c4b8701939d6">SparseMatrix</a>&amp; operator=(<span class="keyword">const</span> Product&lt;Lhs,Rhs,AliasFreeProduct&gt;&amp; other);</div>
<div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// EIGEN_PARSED_BY_DOXYGEN</span></div>
<div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160; </div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;    EIGEN_DONT_INLINE <a class="code" href="classEigen_1_1SparseMatrix.html#a4f28e83ea504f0d8ee76c4b8701939d6">SparseMatrix</a>&amp; operator=(<span class="keyword">const</span> SparseMatrixBase&lt;OtherDerived&gt;&amp; other);</div>
<div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160; </div>
<div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;    <span class="keyword">friend</span> std::ostream &amp; operator &lt;&lt; (std::ostream &amp; s, <span class="keyword">const</span> <a class="code" href="classEigen_1_1SparseMatrix.html#a4f28e83ea504f0d8ee76c4b8701939d6">SparseMatrix</a>&amp; m)</div>
<div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;    {</div>
<div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;      EIGEN_DBG_SPARSE(</div>
<div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;        s &lt;&lt; <span class="stringliteral">&quot;Nonzero entries:\n&quot;</span>;</div>
<div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;        <span class="keywordflow">if</span>(m.isCompressed())</div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;        {</div>
<div class="line"><a name="l00795"></a><span class="lineno">  795</span>&#160;          for (Index i=0; i&lt;m.nonZeros(); ++i)</div>
<div class="line"><a name="l00796"></a><span class="lineno">  796</span>&#160;            s &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; m.m_data.value(i) &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; m.m_data.index(i) &lt;&lt; <span class="stringliteral">&quot;) &quot;</span>;</div>
<div class="line"><a name="l00797"></a><span class="lineno">  797</span>&#160;        }</div>
<div class="line"><a name="l00798"></a><span class="lineno">  798</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00799"></a><span class="lineno">  799</span>&#160;        {</div>
<div class="line"><a name="l00800"></a><span class="lineno">  800</span>&#160;          for (Index i=0; i&lt;m.outerSize(); ++i)</div>
<div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;          {</div>
<div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160;            Index p = m.m_outerIndex[i];</div>
<div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;            Index pe = m.m_outerIndex[i]+m.m_innerNonZeros[i];</div>
<div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;            Index k=p;</div>
<div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;            for (; k&lt;pe; ++k) {</div>
<div class="line"><a name="l00806"></a><span class="lineno">  806</span>&#160;              s &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; m.m_data.value(k) &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; m.m_data.index(k) &lt;&lt; <span class="stringliteral">&quot;) &quot;</span>;</div>
<div class="line"><a name="l00807"></a><span class="lineno">  807</span>&#160;            }</div>
<div class="line"><a name="l00808"></a><span class="lineno">  808</span>&#160;            for (; k&lt;m.m_outerIndex[i+1]; ++k) {</div>
<div class="line"><a name="l00809"></a><span class="lineno">  809</span>&#160;              s &lt;&lt; <span class="stringliteral">&quot;(_,_) &quot;</span>;</div>
<div class="line"><a name="l00810"></a><span class="lineno">  810</span>&#160;            }</div>
<div class="line"><a name="l00811"></a><span class="lineno">  811</span>&#160;          }</div>
<div class="line"><a name="l00812"></a><span class="lineno">  812</span>&#160;        }</div>
<div class="line"><a name="l00813"></a><span class="lineno">  813</span>&#160;        s &lt;&lt; std::endl;</div>
<div class="line"><a name="l00814"></a><span class="lineno">  814</span>&#160;        s &lt;&lt; std::endl;</div>
<div class="line"><a name="l00815"></a><span class="lineno">  815</span>&#160;        s &lt;&lt; <span class="stringliteral">&quot;Outer pointers:\n&quot;</span>;</div>
<div class="line"><a name="l00816"></a><span class="lineno">  816</span>&#160;        <span class="keywordflow">for</span> (<a class="code" href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Index</a> i=0; i&lt;m.outerSize(); ++i) {</div>
<div class="line"><a name="l00817"></a><span class="lineno">  817</span>&#160;          s &lt;&lt; m.m_outerIndex[i] &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160;        }</div>
<div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;        s &lt;&lt; <span class="stringliteral">&quot; $&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160;        <span class="keywordflow">if</span>(!m.isCompressed())</div>
<div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;        {</div>
<div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160;          s &lt;&lt; <span class="stringliteral">&quot;Inner non zeros:\n&quot;</span>;</div>
<div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;          for (Index i=0; i&lt;m.outerSize(); ++i) {</div>
<div class="line"><a name="l00824"></a><span class="lineno">  824</span>&#160;            s &lt;&lt; m.m_innerNonZeros[i] &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00825"></a><span class="lineno">  825</span>&#160;          }</div>
<div class="line"><a name="l00826"></a><span class="lineno">  826</span>&#160;          s &lt;&lt; <span class="stringliteral">&quot; $&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00827"></a><span class="lineno">  827</span>&#160;        }</div>
<div class="line"><a name="l00828"></a><span class="lineno">  828</span>&#160;        s &lt;&lt; std::endl;</div>
<div class="line"><a name="l00829"></a><span class="lineno">  829</span>&#160;      );</div>
<div class="line"><a name="l00830"></a><span class="lineno">  830</span>&#160;      s &lt;&lt; static_cast&lt;const SparseMatrixBase&lt;SparseMatrix&gt;&amp;&gt;(m);</div>
<div class="line"><a name="l00831"></a><span class="lineno">  831</span>&#160;      <span class="keywordflow">return</span> s;</div>
<div class="line"><a name="l00832"></a><span class="lineno">  832</span>&#160;    }</div>
<div class="line"><a name="l00833"></a><span class="lineno">  833</span>&#160; </div>
<div class="line"><a name="l00835"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ac837d39f0ae378ecb132f5ef2d7fa74b">  835</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1SparseMatrix.html#ac837d39f0ae378ecb132f5ef2d7fa74b">~SparseMatrix</a>()</div>
<div class="line"><a name="l00836"></a><span class="lineno">  836</span>&#160;    {</div>
<div class="line"><a name="l00837"></a><span class="lineno">  837</span>&#160;      std::free(m_outerIndex);</div>
<div class="line"><a name="l00838"></a><span class="lineno">  838</span>&#160;      std::free(m_innerNonZeros);</div>
<div class="line"><a name="l00839"></a><span class="lineno">  839</span>&#160;    }</div>
<div class="line"><a name="l00840"></a><span class="lineno">  840</span>&#160; </div>
<div class="line"><a name="l00842"></a><span class="lineno">  842</span>&#160;    Scalar sum() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00843"></a><span class="lineno">  843</span>&#160;    </div>
<div class="line"><a name="l00844"></a><span class="lineno">  844</span>&#160;<span class="preprocessor">#   ifdef EIGEN_SPARSEMATRIX_PLUGIN</span></div>
<div class="line"><a name="l00845"></a><span class="lineno">  845</span>&#160;<span class="preprocessor">#     include EIGEN_SPARSEMATRIX_PLUGIN</span></div>
<div class="line"><a name="l00846"></a><span class="lineno">  846</span>&#160;<span class="preprocessor">#   endif</span></div>
<div class="line"><a name="l00847"></a><span class="lineno">  847</span>&#160; </div>
<div class="line"><a name="l00848"></a><span class="lineno">  848</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00849"></a><span class="lineno">  849</span>&#160; </div>
<div class="line"><a name="l00850"></a><span class="lineno">  850</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Other&gt;</div>
<div class="line"><a name="l00851"></a><span class="lineno">  851</span>&#160;    <span class="keywordtype">void</span> initAssignment(<span class="keyword">const</span> Other&amp; other)</div>
<div class="line"><a name="l00852"></a><span class="lineno">  852</span>&#160;    {</div>
<div class="line"><a name="l00853"></a><span class="lineno">  853</span>&#160;      resize(other.rows(), other.cols());</div>
<div class="line"><a name="l00854"></a><span class="lineno">  854</span>&#160;      <span class="keywordflow">if</span>(m_innerNonZeros)</div>
<div class="line"><a name="l00855"></a><span class="lineno">  855</span>&#160;      {</div>
<div class="line"><a name="l00856"></a><span class="lineno">  856</span>&#160;        std::free(m_innerNonZeros);</div>
<div class="line"><a name="l00857"></a><span class="lineno">  857</span>&#160;        m_innerNonZeros = 0;</div>
<div class="line"><a name="l00858"></a><span class="lineno">  858</span>&#160;      }</div>
<div class="line"><a name="l00859"></a><span class="lineno">  859</span>&#160;    }</div>
<div class="line"><a name="l00860"></a><span class="lineno">  860</span>&#160; </div>
<div class="line"><a name="l00863"></a><span class="lineno">  863</span>&#160;    EIGEN_DONT_INLINE Scalar&amp; insertCompressed(Index row, Index col);</div>
<div class="line"><a name="l00864"></a><span class="lineno">  864</span>&#160; </div>
<div class="line"><a name="l00867"></a><span class="lineno">  867</span>&#160;    <span class="keyword">class </span>SingletonVector</div>
<div class="line"><a name="l00868"></a><span class="lineno">  868</span>&#160;    {</div>
<div class="line"><a name="l00869"></a><span class="lineno">  869</span>&#160;        StorageIndex m_index;</div>
<div class="line"><a name="l00870"></a><span class="lineno">  870</span>&#160;        StorageIndex m_value;</div>
<div class="line"><a name="l00871"></a><span class="lineno">  871</span>&#160;      <span class="keyword">public</span>:</div>
<div class="line"><a name="l00872"></a><span class="lineno">  872</span>&#160;        <span class="keyword">typedef</span> StorageIndex value_type;</div>
<div class="line"><a name="l00873"></a><span class="lineno">  873</span>&#160;        SingletonVector(Index i, Index v)</div>
<div class="line"><a name="l00874"></a><span class="lineno">  874</span>&#160;          : m_index(convert_index(i)), m_value(convert_index(v))</div>
<div class="line"><a name="l00875"></a><span class="lineno">  875</span>&#160;        {}</div>
<div class="line"><a name="l00876"></a><span class="lineno">  876</span>&#160; </div>
<div class="line"><a name="l00877"></a><span class="lineno">  877</span>&#160;        StorageIndex operator[](Index i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> i==m_index ? m_value : 0; }</div>
<div class="line"><a name="l00878"></a><span class="lineno">  878</span>&#160;    };</div>
<div class="line"><a name="l00879"></a><span class="lineno">  879</span>&#160; </div>
<div class="line"><a name="l00882"></a><span class="lineno">  882</span>&#160;    EIGEN_DONT_INLINE Scalar&amp; insertUncompressed(Index row, Index col);</div>
<div class="line"><a name="l00883"></a><span class="lineno">  883</span>&#160; </div>
<div class="line"><a name="l00884"></a><span class="lineno">  884</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00887"></a><span class="lineno">  887</span>&#160;    EIGEN_STRONG_INLINE Scalar&amp; insertBackUncompressed(Index row, Index col)</div>
<div class="line"><a name="l00888"></a><span class="lineno">  888</span>&#160;    {</div>
<div class="line"><a name="l00889"></a><span class="lineno">  889</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> outer = IsRowMajor ? row : col;</div>
<div class="line"><a name="l00890"></a><span class="lineno">  890</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> inner = IsRowMajor ? col : row;</div>
<div class="line"><a name="l00891"></a><span class="lineno">  891</span>&#160; </div>
<div class="line"><a name="l00892"></a><span class="lineno">  892</span>&#160;      eigen_assert(!isCompressed());</div>
<div class="line"><a name="l00893"></a><span class="lineno">  893</span>&#160;      eigen_assert(m_innerNonZeros[outer]&lt;=(m_outerIndex[outer+1] - m_outerIndex[outer]));</div>
<div class="line"><a name="l00894"></a><span class="lineno">  894</span>&#160; </div>
<div class="line"><a name="l00895"></a><span class="lineno">  895</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> p = m_outerIndex[outer] + m_innerNonZeros[outer]++;</div>
<div class="line"><a name="l00896"></a><span class="lineno">  896</span>&#160;      m_data.index(p) = convert_index(inner);</div>
<div class="line"><a name="l00897"></a><span class="lineno">  897</span>&#160;      <span class="keywordflow">return</span> (m_data.value(p) = Scalar(0));</div>
<div class="line"><a name="l00898"></a><span class="lineno">  898</span>&#160;    }</div>
<div class="line"><a name="l00899"></a><span class="lineno">  899</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00900"></a><span class="lineno">  900</span>&#160;    <span class="keyword">struct </span>IndexPosPair {</div>
<div class="line"><a name="l00901"></a><span class="lineno">  901</span>&#160;      IndexPosPair(Index a_i, Index a_p) : i(a_i), p(a_p) {}</div>
<div class="line"><a name="l00902"></a><span class="lineno">  902</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i;</div>
<div class="line"><a name="l00903"></a><span class="lineno">  903</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> p;</div>
<div class="line"><a name="l00904"></a><span class="lineno">  904</span>&#160;    };</div>
<div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160; </div>
<div class="line"><a name="l00919"></a><span class="lineno">  919</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DiagXpr, <span class="keyword">typename</span> Func&gt;</div>
<div class="line"><a name="l00920"></a><span class="lineno">  920</span>&#160;    <span class="keywordtype">void</span> assignDiagonal(<span class="keyword">const</span> DiagXpr diagXpr, <span class="keyword">const</span> Func&amp; assignFunc)</div>
<div class="line"><a name="l00921"></a><span class="lineno">  921</span>&#160;    {</div>
<div class="line"><a name="l00922"></a><span class="lineno">  922</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> n = diagXpr.size();</div>
<div class="line"><a name="l00923"></a><span class="lineno">  923</span>&#160; </div>
<div class="line"><a name="l00924"></a><span class="lineno">  924</span>&#160;      <span class="keyword">const</span> <span class="keywordtype">bool</span> overwrite = internal::is_same&lt;Func, internal::assign_op&lt;Scalar,Scalar&gt; &gt;::value;</div>
<div class="line"><a name="l00925"></a><span class="lineno">  925</span>&#160;      <span class="keywordflow">if</span>(overwrite)</div>
<div class="line"><a name="l00926"></a><span class="lineno">  926</span>&#160;      {</div>
<div class="line"><a name="l00927"></a><span class="lineno">  927</span>&#160;        <span class="keywordflow">if</span>((this-&gt;rows()!=n) || (this-&gt;cols()!=n))</div>
<div class="line"><a name="l00928"></a><span class="lineno">  928</span>&#160;          this-&gt;resize(n, n);</div>
<div class="line"><a name="l00929"></a><span class="lineno">  929</span>&#160;      }</div>
<div class="line"><a name="l00930"></a><span class="lineno">  930</span>&#160; </div>
<div class="line"><a name="l00931"></a><span class="lineno">  931</span>&#160;      <span class="keywordflow">if</span>(m_data.size()==0 || overwrite)</div>
<div class="line"><a name="l00932"></a><span class="lineno">  932</span>&#160;      {</div>
<div class="line"><a name="l00933"></a><span class="lineno">  933</span>&#160;        <span class="keyword">typedef</span> Array&lt;StorageIndex,Dynamic,1&gt; ArrayXI;  </div>
<div class="line"><a name="l00934"></a><span class="lineno">  934</span>&#160;        this-&gt;makeCompressed();</div>
<div class="line"><a name="l00935"></a><span class="lineno">  935</span>&#160;        this-&gt;resizeNonZeros(n);</div>
<div class="line"><a name="l00936"></a><span class="lineno">  936</span>&#160;        <a class="code" href="classEigen_1_1Map.html">Eigen::Map&lt;ArrayXI&gt;</a>(this-&gt;innerIndexPtr(), n).setLinSpaced(0,StorageIndex(n)-1);</div>
<div class="line"><a name="l00937"></a><span class="lineno">  937</span>&#160;        <a class="code" href="classEigen_1_1Map.html">Eigen::Map&lt;ArrayXI&gt;</a>(this-&gt;outerIndexPtr(), n+1).setLinSpaced(0,StorageIndex(n));</div>
<div class="line"><a name="l00938"></a><span class="lineno">  938</span>&#160;        <a class="code" href="classEigen_1_1Map.html">Eigen::Map&lt;Array&lt;Scalar,Dynamic,1&gt;</a> &gt; values = this-&gt;coeffs();</div>
<div class="line"><a name="l00939"></a><span class="lineno">  939</span>&#160;        values.setZero();</div>
<div class="line"><a name="l00940"></a><span class="lineno">  940</span>&#160;        internal::call_assignment_no_alias(values, diagXpr, assignFunc);</div>
<div class="line"><a name="l00941"></a><span class="lineno">  941</span>&#160;      }</div>
<div class="line"><a name="l00942"></a><span class="lineno">  942</span>&#160;      <span class="keywordflow">else</span></div>
<div class="line"><a name="l00943"></a><span class="lineno">  943</span>&#160;      {</div>
<div class="line"><a name="l00944"></a><span class="lineno">  944</span>&#160;        <span class="keywordtype">bool</span> isComp = isCompressed();</div>
<div class="line"><a name="l00945"></a><span class="lineno">  945</span>&#160;        internal::evaluator&lt;DiagXpr&gt; diaEval(diagXpr);</div>
<div class="line"><a name="l00946"></a><span class="lineno">  946</span>&#160;        std::vector&lt;IndexPosPair&gt; newEntries;</div>
<div class="line"><a name="l00947"></a><span class="lineno">  947</span>&#160; </div>
<div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;        <span class="comment">// 1 - try in-place update and record insertion failures</span></div>
<div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160;        <span class="keywordflow">for</span>(Index i = 0; i&lt;n; ++i)</div>
<div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160;        {</div>
<div class="line"><a name="l00951"></a><span class="lineno">  951</span>&#160;          internal::LowerBoundIndex lb = this-&gt;lower_bound(i,i);</div>
<div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;          <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> p = lb.value;</div>
<div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160;          <span class="keywordflow">if</span>(lb.found)</div>
<div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160;          {</div>
<div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160;            <span class="comment">// the coeff already exists</span></div>
<div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160;            assignFunc.assignCoeff(m_data.value(p), diaEval.coeff(i));</div>
<div class="line"><a name="l00957"></a><span class="lineno">  957</span>&#160;          }</div>
<div class="line"><a name="l00958"></a><span class="lineno">  958</span>&#160;          <span class="keywordflow">else</span> <span class="keywordflow">if</span>((!isComp) &amp;&amp; m_innerNonZeros[i] &lt; (m_outerIndex[i+1]-m_outerIndex[i]))</div>
<div class="line"><a name="l00959"></a><span class="lineno">  959</span>&#160;          {</div>
<div class="line"><a name="l00960"></a><span class="lineno">  960</span>&#160;            <span class="comment">// non compressed mode with local room for inserting one element</span></div>
<div class="line"><a name="l00961"></a><span class="lineno">  961</span>&#160;            m_data.moveChunk(p, p+1, m_outerIndex[i]+m_innerNonZeros[i]-p);</div>
<div class="line"><a name="l00962"></a><span class="lineno">  962</span>&#160;            m_innerNonZeros[i]++;</div>
<div class="line"><a name="l00963"></a><span class="lineno">  963</span>&#160;            m_data.value(p) = Scalar(0);</div>
<div class="line"><a name="l00964"></a><span class="lineno">  964</span>&#160;            m_data.index(p) = StorageIndex(i);</div>
<div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;            assignFunc.assignCoeff(m_data.value(p), diaEval.coeff(i));</div>
<div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;          }</div>
<div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;          <span class="keywordflow">else</span></div>
<div class="line"><a name="l00968"></a><span class="lineno">  968</span>&#160;          {</div>
<div class="line"><a name="l00969"></a><span class="lineno">  969</span>&#160;            <span class="comment">// defer insertion</span></div>
<div class="line"><a name="l00970"></a><span class="lineno">  970</span>&#160;            newEntries.push_back(IndexPosPair(i,p));</div>
<div class="line"><a name="l00971"></a><span class="lineno">  971</span>&#160;          }</div>
<div class="line"><a name="l00972"></a><span class="lineno">  972</span>&#160;        }</div>
<div class="line"><a name="l00973"></a><span class="lineno">  973</span>&#160;        <span class="comment">// 2 - insert deferred entries</span></div>
<div class="line"><a name="l00974"></a><span class="lineno">  974</span>&#160;        <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> n_entries = <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a>(newEntries.size());</div>
<div class="line"><a name="l00975"></a><span class="lineno">  975</span>&#160;        <span class="keywordflow">if</span>(n_entries&gt;0)</div>
<div class="line"><a name="l00976"></a><span class="lineno">  976</span>&#160;        {</div>
<div class="line"><a name="l00977"></a><span class="lineno">  977</span>&#160;          Storage newData(m_data.size()+n_entries);</div>
<div class="line"><a name="l00978"></a><span class="lineno">  978</span>&#160;          <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> prev_p = 0;</div>
<div class="line"><a name="l00979"></a><span class="lineno">  979</span>&#160;          <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> prev_i = 0;</div>
<div class="line"><a name="l00980"></a><span class="lineno">  980</span>&#160;          <span class="keywordflow">for</span>(Index k=0; k&lt;n_entries;++k)</div>
<div class="line"><a name="l00981"></a><span class="lineno">  981</span>&#160;          {</div>
<div class="line"><a name="l00982"></a><span class="lineno">  982</span>&#160;            <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i = newEntries[k].i;</div>
<div class="line"><a name="l00983"></a><span class="lineno">  983</span>&#160;            <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> p = newEntries[k].p;</div>
<div class="line"><a name="l00984"></a><span class="lineno">  984</span>&#160;            internal::smart_copy(m_data.valuePtr()+prev_p, m_data.valuePtr()+p, newData.valuePtr()+prev_p+k);</div>
<div class="line"><a name="l00985"></a><span class="lineno">  985</span>&#160;            internal::smart_copy(m_data.indexPtr()+prev_p, m_data.indexPtr()+p, newData.indexPtr()+prev_p+k);</div>
<div class="line"><a name="l00986"></a><span class="lineno">  986</span>&#160;            <span class="keywordflow">for</span>(Index j=prev_i;j&lt;i;++j)</div>
<div class="line"><a name="l00987"></a><span class="lineno">  987</span>&#160;              m_outerIndex[j+1] += k;</div>
<div class="line"><a name="l00988"></a><span class="lineno">  988</span>&#160;            <span class="keywordflow">if</span>(!isComp)</div>
<div class="line"><a name="l00989"></a><span class="lineno">  989</span>&#160;              m_innerNonZeros[i]++;</div>
<div class="line"><a name="l00990"></a><span class="lineno">  990</span>&#160;            prev_p = p;</div>
<div class="line"><a name="l00991"></a><span class="lineno">  991</span>&#160;            prev_i = i;</div>
<div class="line"><a name="l00992"></a><span class="lineno">  992</span>&#160;            newData.value(p+k) = Scalar(0);</div>
<div class="line"><a name="l00993"></a><span class="lineno">  993</span>&#160;            newData.index(p+k) = StorageIndex(i);</div>
<div class="line"><a name="l00994"></a><span class="lineno">  994</span>&#160;            assignFunc.assignCoeff(newData.value(p+k), diaEval.coeff(i));</div>
<div class="line"><a name="l00995"></a><span class="lineno">  995</span>&#160;          }</div>
<div class="line"><a name="l00996"></a><span class="lineno">  996</span>&#160;          {</div>
<div class="line"><a name="l00997"></a><span class="lineno">  997</span>&#160;            internal::smart_copy(m_data.valuePtr()+prev_p, m_data.valuePtr()+m_data.size(), newData.valuePtr()+prev_p+n_entries);</div>
<div class="line"><a name="l00998"></a><span class="lineno">  998</span>&#160;            internal::smart_copy(m_data.indexPtr()+prev_p, m_data.indexPtr()+m_data.size(), newData.indexPtr()+prev_p+n_entries);</div>
<div class="line"><a name="l00999"></a><span class="lineno">  999</span>&#160;            <span class="keywordflow">for</span>(Index j=prev_i+1;j&lt;=m_outerSize;++j)</div>
<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>&#160;              m_outerIndex[j] += n_entries;</div>
<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>&#160;          }</div>
<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>&#160;          m_data.swap(newData);</div>
<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>&#160;        }</div>
<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>&#160;      }</div>
<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>&#160;    }</div>
<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>&#160; </div>
<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>&#160;  EIGEN_STATIC_ASSERT(NumTraits&lt;StorageIndex&gt;::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE)</div>
<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160;  EIGEN_STATIC_ASSERT((Options&amp;(<a class="code" href="group__enums.html#ggaacded1a18ae58b0f554751f6cdf9eb13a0103672ae41005ab03b4176c765afd62">ColMajor</a>|<a class="code" href="group__enums.html#ggaacded1a18ae58b0f554751f6cdf9eb13a77c993a8d9f6efe5c1159fb2ab07dd4f">RowMajor</a>))==Options,INVALID_MATRIX_TEMPLATE_PARAMETERS)</div>
<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160; </div>
<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160;  <span class="keyword">struct </span>default_prunning_func {</div>
<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>&#160;    default_prunning_func(<span class="keyword">const</span> Scalar&amp; ref, <span class="keyword">const</span> RealScalar&amp; eps) : reference(ref), epsilon(eps) {}</div>
<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator() (<span class="keyword">const</span> Index&amp;, <span class="keyword">const</span> Index&amp;, <span class="keyword">const</span> Scalar&amp; value)<span class="keyword"> const</span></div>
<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160;<span class="keyword">    </span>{</div>
<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;      <span class="keywordflow">return</span> !internal::isMuchSmallerThan(value, reference, epsilon);</div>
<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160;    }</div>
<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;    Scalar reference;</div>
<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160;    RealScalar epsilon;</div>
<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160;  };</div>
<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160;};</div>
<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160; </div>
<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160;<span class="keyword">namespace </span>internal {</div>
<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160; </div>
<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> InputIterator, <span class="keyword">typename</span> SparseMatrixType, <span class="keyword">typename</span> DupFunctor&gt;</div>
<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;<span class="keywordtype">void</span> set_from_triplets(<span class="keyword">const</span> InputIterator&amp; begin, <span class="keyword">const</span> InputIterator&amp; <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>, SparseMatrixType&amp; mat, DupFunctor dup_func)</div>
<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160;{</div>
<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160;  <span class="keyword">enum</span> { IsRowMajor = SparseMatrixType::IsRowMajor };</div>
<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> SparseMatrixType::Scalar Scalar;</div>
<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> SparseMatrixType::StorageIndex StorageIndex;</div>
<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>&#160;  SparseMatrix&lt;Scalar,IsRowMajor?ColMajor:RowMajor,StorageIndex&gt; trMat(mat.rows(),mat.cols());</div>
<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>&#160; </div>
<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>&#160;  <span class="keywordflow">if</span>(begin!=<a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>)</div>
<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>&#160;  {</div>
<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>&#160;    <span class="comment">// pass 1: count the nnz per inner-vector</span></div>
<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>&#160;    <span class="keyword">typename</span> SparseMatrixType::IndexVector wi(trMat.outerSize());</div>
<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>&#160;    wi.setZero();</div>
<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>&#160;    <span class="keywordflow">for</span>(InputIterator it(begin); it!=<a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>; ++it)</div>
<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>&#160;    {</div>
<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>&#160;      eigen_assert(it-&gt;row()&gt;=0 &amp;&amp; it-&gt;row()&lt;mat.rows() &amp;&amp; it-&gt;col()&gt;=0 &amp;&amp; it-&gt;col()&lt;mat.cols());</div>
<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>&#160;      wi(IsRowMajor ? it-&gt;col() : it-&gt;row())++;</div>
<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>&#160;    }</div>
<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>&#160; </div>
<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>&#160;    <span class="comment">// pass 2: insert all the elements into trMat</span></div>
<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>&#160;    trMat.reserve(wi);</div>
<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>&#160;    <span class="keywordflow">for</span>(InputIterator it(begin); it!=<a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>; ++it)</div>
<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>&#160;      trMat.insertBackUncompressed(it-&gt;row(),it-&gt;col()) = it-&gt;value();</div>
<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>&#160; </div>
<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>&#160;    <span class="comment">// pass 3:</span></div>
<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>&#160;    trMat.collapseDuplicates(dup_func);</div>
<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>&#160;  }</div>
<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>&#160; </div>
<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>&#160;  <span class="comment">// pass 4: transposed copy -&gt; implicit sorting</span></div>
<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>&#160;  mat = trMat;</div>
<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>&#160;}</div>
<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>&#160; </div>
<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>&#160;}</div>
<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>&#160; </div>
<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>&#160; </div>
<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> InputIterators&gt;</div>
<div class="line"><a name="l01098"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a8f09e3597f37aa8861599260af6a53e0"> 1098</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix&lt;Scalar,Options_,StorageIndex_&gt;::setFromTriplets</a>(<span class="keyword">const</span> InputIterators&amp; begin, <span class="keyword">const</span> InputIterators&amp; <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>)</div>
<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>&#160;{</div>
<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>&#160;  internal::set_from_triplets&lt;InputIterators, SparseMatrix&lt;Scalar,Options_,StorageIndex_&gt; &gt;(begin, <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>, *<span class="keyword">this</span>, internal::scalar_sum_op&lt;Scalar,Scalar&gt;());</div>
<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>&#160;}</div>
<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>&#160; </div>
<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> InputIterators,<span class="keyword">typename</span> DupFunctor&gt;</div>
<div class="line"><a name="l01114"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#a3e8c96b7dd72d03f14b5cf40f5005d55"> 1114</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix&lt;Scalar,Options_,StorageIndex_&gt;::setFromTriplets</a>(<span class="keyword">const</span> InputIterators&amp; begin, <span class="keyword">const</span> InputIterators&amp; <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>, DupFunctor dup_func)</div>
<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>&#160;{</div>
<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>&#160;  internal::set_from_triplets&lt;InputIterators, SparseMatrix&lt;Scalar,Options_,StorageIndex_&gt;, DupFunctor&gt;(begin, <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>, *<span class="keyword">this</span>, dup_func);</div>
<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>&#160;}</div>
<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>&#160; </div>
<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> DupFunctor&gt;</div>
<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>&#160;<span class="keywordtype">void</span> <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix&lt;Scalar,Options_,StorageIndex_&gt;::collapseDuplicates</a>(DupFunctor dup_func)</div>
<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>&#160;{</div>
<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>&#160;  eigen_assert(!isCompressed());</div>
<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>&#160;  <span class="comment">// TODO, in practice we should be able to use m_innerNonZeros for that task</span></div>
<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>&#160;  IndexVector wi(innerSize());</div>
<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>&#160;  wi.fill(-1);</div>
<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>&#160;  StorageIndex count = 0;</div>
<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>&#160;  <span class="comment">// for each inner-vector, wi[inner_index] will hold the position of first element into the index/value buffers</span></div>
<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>&#160;  <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j=0; j&lt;outerSize(); ++j)</div>
<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>&#160;  {</div>
<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>&#160;    StorageIndex start   = count;</div>
<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>&#160;    <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> oldEnd  = m_outerIndex[j]+m_innerNonZeros[j];</div>
<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>&#160;    <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> k=m_outerIndex[j]; k&lt;oldEnd; ++k)</div>
<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>&#160;    {</div>
<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i = m_data.index(k);</div>
<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>&#160;      <span class="keywordflow">if</span>(wi(i)&gt;=start)</div>
<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>&#160;      {</div>
<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>&#160;        <span class="comment">// we already meet this entry =&gt; accumulate it</span></div>
<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>&#160;        m_data.value(wi(i)) = dup_func(m_data.value(wi(i)), m_data.value(k));</div>
<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>&#160;      }</div>
<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>&#160;      <span class="keywordflow">else</span></div>
<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>&#160;      {</div>
<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>&#160;        m_data.value(count) = m_data.value(k);</div>
<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>&#160;        m_data.index(count) = m_data.index(k);</div>
<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>&#160;        wi(i) = count;</div>
<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>&#160;        ++count;</div>
<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>&#160;      }</div>
<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>&#160;    }</div>
<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>&#160;    m_outerIndex[j] = start;</div>
<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>&#160;  }</div>
<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>&#160;  m_outerIndex[m_outerSize] = count;</div>
<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>&#160; </div>
<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>&#160;  <span class="comment">// turn the matrix into compressed form</span></div>
<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>&#160;  std::free(m_innerNonZeros);</div>
<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>&#160;  m_innerNonZeros = 0;</div>
<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>&#160;  m_data.resize(m_outerIndex[m_outerSize]);</div>
<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>&#160;}</div>
<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>&#160; </div>
<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;</div>
<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>&#160;EIGEN_DONT_INLINE SparseMatrix&lt;Scalar,Options_,StorageIndex_&gt;&amp; SparseMatrix&lt;Scalar,Options_,StorageIndex_&gt;::operator=(<span class="keyword">const</span> SparseMatrixBase&lt;OtherDerived&gt;&amp; other)</div>
<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>&#160;{</div>
<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>&#160;  EIGEN_STATIC_ASSERT((internal::is_same&lt;Scalar, typename OtherDerived::Scalar&gt;::value),</div>
<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>&#160;        YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)</div>
<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>&#160; </div>
<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>&#160;  <span class="preprocessor">#ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN</span></div>
<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>&#160;    EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN</div>
<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>&#160;<span class="preprocessor">  #endif</span></div>
<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>&#160;      </div>
<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">bool</span> needToTranspose = (Flags &amp; <a class="code" href="group__flags.html#gae4f56c2a60bbe4bd2e44c5b19cbe8762">RowMajorBit</a>) != (internal::evaluator&lt;OtherDerived&gt;::Flags &amp; <a class="code" href="group__flags.html#gae4f56c2a60bbe4bd2e44c5b19cbe8762">RowMajorBit</a>);</div>
<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>&#160;  <span class="keywordflow">if</span> (needToTranspose)</div>
<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>&#160;  {</div>
<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>&#160;<span class="preprocessor">    #ifdef EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN</span></div>
<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>&#160;      EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN</div>
<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>&#160;<span class="preprocessor">    #endif</span></div>
<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>&#160;    <span class="comment">// two passes algorithm:</span></div>
<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>&#160;    <span class="comment">//  1 - compute the number of coeffs per dest inner vector</span></div>
<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>&#160;    <span class="comment">//  2 - do the actual copy/eval</span></div>
<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>&#160;    <span class="comment">// Since each coeff of the rhs has to be evaluated twice, let&#39;s evaluate it if needed</span></div>
<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> internal::nested_eval&lt;OtherDerived,2,typename internal::plain_matrix_type&lt;OtherDerived&gt;::type &gt;::type OtherCopy;</div>
<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>&#160;    <span class="keyword">typedef</span> internal::remove_all_t&lt;OtherCopy&gt; OtherCopy_;</div>
<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>&#160;    <span class="keyword">typedef</span> internal::evaluator&lt;OtherCopy_&gt; OtherCopyEval;</div>
<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>&#160;    OtherCopy otherCopy(other.derived());</div>
<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>&#160;    OtherCopyEval otherCopyEval(otherCopy);</div>
<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>&#160; </div>
<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>&#160;    SparseMatrix dest(other.rows(),other.cols());</div>
<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>&#160;    <a class="code" href="classEigen_1_1Map.html">Eigen::Map&lt;IndexVector&gt;</a> (dest.m_outerIndex,dest.outerSize()).setZero();</div>
<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>&#160; </div>
<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>&#160;    <span class="comment">// pass 1</span></div>
<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>&#160;    <span class="comment">// FIXME the above copy could be merged with that pass</span></div>
<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>&#160;    <span class="keywordflow">for</span> (Index j=0; j&lt;otherCopy.outerSize(); ++j)</div>
<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>&#160;      <span class="keywordflow">for</span> (<span class="keyword">typename</span> OtherCopyEval::InnerIterator it(otherCopyEval, j); it; ++it)</div>
<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>&#160;        ++dest.m_outerIndex[it.index()];</div>
<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>&#160; </div>
<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>&#160;    <span class="comment">// prefix sum</span></div>
<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>&#160;    StorageIndex count = 0;</div>
<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>&#160;    IndexVector positions(dest.outerSize());</div>
<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>&#160;    <span class="keywordflow">for</span> (Index j=0; j&lt;dest.outerSize(); ++j)</div>
<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>&#160;    {</div>
<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>&#160;      StorageIndex tmp = dest.m_outerIndex[j];</div>
<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>&#160;      dest.m_outerIndex[j] = count;</div>
<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>&#160;      positions[j] = count;</div>
<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>&#160;      count += tmp;</div>
<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>&#160;    }</div>
<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>&#160;    dest.m_outerIndex[dest.outerSize()] = count;</div>
<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>&#160;    <span class="comment">// alloc</span></div>
<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>&#160;    dest.m_data.resize(count);</div>
<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>&#160;    <span class="comment">// pass 2</span></div>
<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>&#160;    <span class="keywordflow">for</span> (StorageIndex j=0; j&lt;otherCopy.outerSize(); ++j)</div>
<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>&#160;    {</div>
<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>&#160;      <span class="keywordflow">for</span> (<span class="keyword">typename</span> OtherCopyEval::InnerIterator it(otherCopyEval, j); it; ++it)</div>
<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>&#160;      {</div>
<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>&#160;        <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> pos = positions[it.index()]++;</div>
<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>&#160;        dest.m_data.index(pos) = j;</div>
<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>&#160;        dest.m_data.value(pos) = it.value();</div>
<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>&#160;      }</div>
<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>&#160;    }</div>
<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>&#160;    this-&gt;swap(dest);</div>
<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>&#160;  }</div>
<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>&#160;  <span class="keywordflow">else</span></div>
<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>&#160;  {</div>
<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>&#160;    <span class="keywordflow">if</span>(other.isRValue())</div>
<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>&#160;    {</div>
<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>&#160;      initAssignment(other.derived());</div>
<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>&#160;    }</div>
<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>&#160;    <span class="comment">// there is no special optimization</span></div>
<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>&#160;    <span class="keywordflow">return</span> Base::operator=(other.derived());</div>
<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>&#160;  }</div>
<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>&#160;}</div>
<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>&#160; </div>
<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar_, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l01234"></a><span class="lineno"><a class="line" href="classEigen_1_1SparseMatrix.html#ae2d8f72ff86a300b76f9edd67df8d8fd"> 1234</a></span>&#160;<span class="keyword">typename</span> SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt;::Scalar&amp; <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt;::insert</a>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> row, <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> col)</div>
<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>&#160;{</div>
<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>&#160;  eigen_assert(row&gt;=0 &amp;&amp; row&lt;rows() &amp;&amp; col&gt;=0 &amp;&amp; col&lt;cols());</div>
<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>&#160;  </div>
<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>&#160;  <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> outer = IsRowMajor ? row : col;</div>
<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>&#160;  <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> inner = IsRowMajor ? col : row;</div>
<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>&#160;  </div>
<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>&#160;  <span class="keywordflow">if</span>(isCompressed())</div>
<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>&#160;  {</div>
<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>&#160;    <span class="keywordflow">if</span>(nonZeros()==0)</div>
<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>&#160;    {</div>
<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>&#160;      <span class="comment">// reserve space if not already done</span></div>
<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>&#160;      <span class="keywordflow">if</span>(m_data.allocatedSize()==0)</div>
<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>&#160;        m_data.reserve(2*m_innerSize);</div>
<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>&#160;      </div>
<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>&#160;      <span class="comment">// turn the matrix into non-compressed mode</span></div>
<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>&#160;      m_innerNonZeros = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::malloc(m_outerSize * <span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>&#160;      <span class="keywordflow">if</span>(!m_innerNonZeros) internal::throw_std_bad_alloc();</div>
<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>&#160;      </div>
<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>&#160;      std::fill(m_innerNonZeros, m_innerNonZeros + m_outerSize, <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>(0));</div>
<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>&#160;      </div>
<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>&#160;      <span class="comment">// pack all inner-vectors to the end of the pre-allocated space</span></div>
<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>&#160;      <span class="comment">// and allocate the entire free-space to the first inner-vector</span></div>
<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a> = convert_index(m_data.allocatedSize());</div>
<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>&#160;      <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j=1; j&lt;=m_outerSize; ++j)</div>
<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>&#160;        m_outerIndex[j] = <a class="code" href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">end</a>;</div>
<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>&#160;    }</div>
<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>&#160;    {</div>
<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>&#160;      <span class="comment">// turn the matrix into non-compressed mode</span></div>
<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>&#160;      m_innerNonZeros = <span class="keyword">static_cast&lt;</span><a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>*<span class="keyword">&gt;</span>(std::malloc(m_outerSize * <span class="keyword">sizeof</span>(<a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a>)));</div>
<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>&#160;      <span class="keywordflow">if</span>(!m_innerNonZeros) internal::throw_std_bad_alloc();</div>
<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>&#160;      <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j=0; j&lt;m_outerSize; ++j)</div>
<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>&#160;        m_innerNonZeros[j] = m_outerIndex[j+1]-m_outerIndex[j];</div>
<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>&#160;    }</div>
<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>&#160;  }</div>
<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>&#160;  </div>
<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>&#160;  <span class="comment">// check whether we can do a fast &quot;push back&quot; insertion</span></div>
<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>&#160;  <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> data_end = m_data.allocatedSize();</div>
<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>&#160;  </div>
<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>&#160;  <span class="comment">// First case: we are filling a new inner vector which is packed at the end.</span></div>
<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>&#160;  <span class="comment">// We assume that all remaining inner-vectors are also empty and packed to the end.</span></div>
<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>&#160;  <span class="keywordflow">if</span>(m_outerIndex[outer]==data_end)</div>
<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>&#160;  {</div>
<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>&#160;    eigen_internal_assert(m_innerNonZeros[outer]==0);</div>
<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>&#160;    </div>
<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>&#160;    <span class="comment">// pack previous empty inner-vectors to end of the used-space</span></div>
<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>&#160;    <span class="comment">// and allocate the entire free-space to the current inner-vector.</span></div>
<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>&#160;    <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> p = convert_index(m_data.size());</div>
<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>&#160;    <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j = outer;</div>
<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>&#160;    <span class="keywordflow">while</span>(j&gt;=0 &amp;&amp; m_innerNonZeros[j]==0)</div>
<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>&#160;      m_outerIndex[j--] = p;</div>
<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>&#160;    </div>
<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>&#160;    <span class="comment">// push back the new element</span></div>
<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>&#160;    ++m_innerNonZeros[outer];</div>
<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>&#160;    m_data.append(Scalar(0), inner);</div>
<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>&#160;    </div>
<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>&#160;    <span class="comment">// check for reallocation</span></div>
<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>&#160;    <span class="keywordflow">if</span>(data_end != m_data.allocatedSize())</div>
<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>&#160;    {</div>
<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>&#160;      <span class="comment">// m_data has been reallocated</span></div>
<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>&#160;      <span class="comment">//  -&gt; move remaining inner-vectors back to the end of the free-space</span></div>
<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>&#160;      <span class="comment">//     so that the entire free-space is allocated to the current inner-vector.</span></div>
<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>&#160;      eigen_internal_assert(data_end &lt; m_data.allocatedSize());</div>
<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> new_end = convert_index(m_data.allocatedSize());</div>
<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>&#160;      <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> k=outer+1; k&lt;=m_outerSize; ++k)</div>
<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>&#160;        <span class="keywordflow">if</span>(m_outerIndex[k]==data_end)</div>
<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>&#160;          m_outerIndex[k] = new_end;</div>
<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>&#160;    }</div>
<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>&#160;    <span class="keywordflow">return</span> m_data.value(p);</div>
<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>&#160;  }</div>
<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>&#160;  </div>
<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>&#160;  <span class="comment">// Second case: the next inner-vector is packed to the end</span></div>
<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>&#160;  <span class="comment">// and the current inner-vector end match the used-space.</span></div>
<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>&#160;  <span class="keywordflow">if</span>(m_outerIndex[outer+1]==data_end &amp;&amp; m_outerIndex[outer]+m_innerNonZeros[outer]==m_data.size())</div>
<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>&#160;  {</div>
<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>&#160;    eigen_internal_assert(outer+1==m_outerSize || m_innerNonZeros[outer+1]==0);</div>
<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>&#160;    </div>
<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>&#160;    <span class="comment">// add space for the new element</span></div>
<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>&#160;    ++m_innerNonZeros[outer];</div>
<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>&#160;    m_data.resize(m_data.size()+1);</div>
<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>&#160;    </div>
<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>&#160;    <span class="comment">// check for reallocation</span></div>
<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>&#160;    <span class="keywordflow">if</span>(data_end != m_data.allocatedSize())</div>
<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>&#160;    {</div>
<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>&#160;      <span class="comment">// m_data has been reallocated</span></div>
<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>&#160;      <span class="comment">//  -&gt; move remaining inner-vectors back to the end of the free-space</span></div>
<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>&#160;      <span class="comment">//     so that the entire free-space is allocated to the current inner-vector.</span></div>
<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>&#160;      eigen_internal_assert(data_end &lt; m_data.allocatedSize());</div>
<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>&#160;      <a class="code" href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">StorageIndex</a> new_end = convert_index(m_data.allocatedSize());</div>
<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>&#160;      <span class="keywordflow">for</span>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> k=outer+1; k&lt;=m_outerSize; ++k)</div>
<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>&#160;        <span class="keywordflow">if</span>(m_outerIndex[k]==data_end)</div>
<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>&#160;          m_outerIndex[k] = new_end;</div>
<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>&#160;    }</div>
<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>&#160;    </div>
<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>&#160;    <span class="comment">// and insert it at the right position (sorted insertion)</span></div>
<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>&#160;    <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> startId = m_outerIndex[outer];</div>
<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>&#160;    <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> p = m_outerIndex[outer]+m_innerNonZeros[outer]-1;</div>
<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>&#160;    <span class="keywordflow">while</span> ( (p &gt; startId) &amp;&amp; (m_data.index(p-1) &gt; inner) )</div>
<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>&#160;    {</div>
<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>&#160;      m_data.index(p) = m_data.index(p-1);</div>
<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>&#160;      m_data.value(p) = m_data.value(p-1);</div>
<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>&#160;      --p;</div>
<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>&#160;    }</div>
<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>&#160;    </div>
<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>&#160;    m_data.index(p) = convert_index(inner);</div>
<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>&#160;    <span class="keywordflow">return</span> (m_data.value(p) = Scalar(0));</div>
<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>&#160;  }</div>
<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>&#160;  </div>
<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>&#160;  <span class="keywordflow">if</span>(m_data.size() != m_data.allocatedSize())</div>
<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>&#160;  {</div>
<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>&#160;    <span class="comment">// make sure the matrix is compatible to random un-compressed insertion:</span></div>
<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>&#160;    m_data.resize(m_data.allocatedSize());</div>
<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>&#160;    this-&gt;reserveInnerVectors(<a class="code" href="classEigen_1_1Array.html">Array&lt;StorageIndex,Dynamic,1&gt;::Constant</a>(m_outerSize, 2));</div>
<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>&#160;  }</div>
<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>&#160;  </div>
<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>&#160;  <span class="keywordflow">return</span> insertUncompressed(row,col);</div>
<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>&#160;}</div>
<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>&#160;    </div>
<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar_, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>&#160;EIGEN_DONT_INLINE <span class="keyword">typename</span> SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt;::Scalar&amp; <a class="code" href="classEigen_1_1SparseMatrix.html">SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt;::insertUncompressed</a>(<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> row, <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> col)</div>
<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>&#160;{</div>
<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>&#160;  eigen_assert(!isCompressed());</div>
<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>&#160; </div>
<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>&#160;  <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> outer = IsRowMajor ? row : col;</div>
<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>&#160;  <span class="keyword">const</span> StorageIndex inner = convert_index(IsRowMajor ? col : row);</div>
<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>&#160; </div>
<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>&#160;  <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> room = m_outerIndex[outer+1] - m_outerIndex[outer];</div>
<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>&#160;  StorageIndex innerNNZ = m_innerNonZeros[outer];</div>
<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>&#160;  <span class="keywordflow">if</span>(innerNNZ&gt;=room)</div>
<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>&#160;  {</div>
<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>&#160;    <span class="comment">// this inner vector is full, we need to reallocate the whole buffer :(</span></div>
<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>&#160;    reserve(SingletonVector(outer,std::max&lt;StorageIndex&gt;(2,innerNNZ)));</div>
<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>&#160;  }</div>
<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>&#160; </div>
<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>&#160;  Index startId = m_outerIndex[outer];</div>
<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>&#160;  Index p = startId + m_innerNonZeros[outer];</div>
<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>&#160;  <span class="keywordflow">while</span> ( (p &gt; startId) &amp;&amp; (m_data.index(p-1) &gt; inner) )</div>
<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>&#160;  {</div>
<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>&#160;    m_data.index(p) = m_data.index(p-1);</div>
<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>&#160;    m_data.value(p) = m_data.value(p-1);</div>
<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>&#160;    --p;</div>
<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>&#160;  }</div>
<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>&#160;  eigen_assert((p&lt;=startId || m_data.index(p-1)!=inner) &amp;&amp; <span class="stringliteral">&quot;you cannot insert an element that already exists, you must call coeffRef to this end&quot;</span>);</div>
<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>&#160; </div>
<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>&#160;  m_innerNonZeros[outer]++;</div>
<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>&#160; </div>
<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>&#160;  m_data.index(p) = inner;</div>
<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>&#160;  <span class="keywordflow">return</span> (m_data.value(p) = Scalar(0));</div>
<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>&#160;}</div>
<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>&#160; </div>
<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar_, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>&#160;EIGEN_DONT_INLINE <span class="keyword">typename</span> SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt;::Scalar&amp; SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt;::insertCompressed(Index row, Index col)</div>
<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>&#160;{</div>
<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>&#160;  eigen_assert(isCompressed());</div>
<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>&#160; </div>
<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>&#160;  <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> outer = IsRowMajor ? row : col;</div>
<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>&#160;  <span class="keyword">const</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> inner = IsRowMajor ? col : row;</div>
<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>&#160; </div>
<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>&#160;  <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> previousOuter = outer;</div>
<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>&#160;  <span class="keywordflow">if</span> (m_outerIndex[outer+1]==0)</div>
<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>&#160;  {</div>
<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>&#160;    <span class="comment">// we start a new inner vector</span></div>
<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>&#160;    <span class="keywordflow">while</span> (previousOuter&gt;=0 &amp;&amp; m_outerIndex[previousOuter]==0)</div>
<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>&#160;    {</div>
<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>&#160;      m_outerIndex[previousOuter] = convert_index(m_data.size());</div>
<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>&#160;      --previousOuter;</div>
<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>&#160;    }</div>
<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>&#160;    m_outerIndex[outer+1] = m_outerIndex[outer];</div>
<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>&#160;  }</div>
<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>&#160; </div>
<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>&#160;  <span class="comment">// here we have to handle the tricky case where the outerIndex array</span></div>
<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>&#160;  <span class="comment">// starts with: [ 0 0 0 0 0 1 ...] and we are inserted in, e.g.,</span></div>
<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>&#160;  <span class="comment">// the 2nd inner vector...</span></div>
<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>&#160;  <span class="keywordtype">bool</span> isLastVec = (!(previousOuter==-1 &amp;&amp; m_data.size()!=0))</div>
<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>&#160;                &amp;&amp; (std::size_t(m_outerIndex[outer+1]) == m_data.size());</div>
<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>&#160; </div>
<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>&#160;  std::size_t startId = m_outerIndex[outer];</div>
<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>&#160;  <span class="comment">// FIXME let&#39;s make sure sizeof(long int) == sizeof(std::size_t)</span></div>
<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>&#160;  std::size_t p = m_outerIndex[outer+1];</div>
<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>&#160;  ++m_outerIndex[outer+1];</div>
<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>&#160; </div>
<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>&#160;  <span class="keywordtype">double</span> reallocRatio = 1;</div>
<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>&#160;  <span class="keywordflow">if</span> (m_data.allocatedSize()&lt;=m_data.size())</div>
<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>&#160;  {</div>
<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>&#160;    <span class="comment">// if there is no preallocated memory, let&#39;s reserve a minimum of 32 elements</span></div>
<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>&#160;    <span class="keywordflow">if</span> (m_data.size()==0)</div>
<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>&#160;    {</div>
<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>&#160;      m_data.reserve(32);</div>
<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>&#160;    }</div>
<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>&#160;    {</div>
<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>&#160;      <span class="comment">// we need to reallocate the data, to reduce multiple reallocations</span></div>
<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>&#160;      <span class="comment">// we use a smart resize algorithm based on the current filling ratio</span></div>
<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>&#160;      <span class="comment">// in addition, we use double to avoid integers overflows</span></div>
<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>&#160;      <span class="keywordtype">double</span> nnzEstimate = double(m_outerIndex[outer])*double(m_outerSize)/double(outer+1);</div>
<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>&#160;      reallocRatio = (nnzEstimate-double(m_data.size()))/<span class="keywordtype">double</span>(m_data.size());</div>
<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>&#160;      <span class="comment">// furthermore we bound the realloc ratio to:</span></div>
<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>&#160;      <span class="comment">//   1) reduce multiple minor realloc when the matrix is almost filled</span></div>
<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>&#160;      <span class="comment">//   2) avoid to allocate too much memory when the matrix is almost empty</span></div>
<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>&#160;      reallocRatio = (std::min)((std::max)(reallocRatio,1.5),8.);</div>
<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>&#160;    }</div>
<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>&#160;  }</div>
<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>&#160;  m_data.resize(m_data.size()+1,reallocRatio);</div>
<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>&#160; </div>
<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>&#160;  <span class="keywordflow">if</span> (!isLastVec)</div>
<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>&#160;  {</div>
<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>&#160;    <span class="keywordflow">if</span> (previousOuter==-1)</div>
<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>&#160;    {</div>
<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>&#160;      <span class="comment">// oops wrong guess.</span></div>
<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>&#160;      <span class="comment">// let&#39;s correct the outer offsets</span></div>
<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>&#160;      <span class="keywordflow">for</span> (Index k=0; k&lt;=(outer+1); ++k)</div>
<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>&#160;        m_outerIndex[k] = 0;</div>
<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> k=outer+1;</div>
<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>&#160;      <span class="keywordflow">while</span>(m_outerIndex[k]==0)</div>
<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>&#160;        m_outerIndex[k++] = 1;</div>
<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>&#160;      <span class="keywordflow">while</span> (k&lt;=m_outerSize &amp;&amp; m_outerIndex[k]!=0)</div>
<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>&#160;        m_outerIndex[k++]++;</div>
<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>&#160;      p = 0;</div>
<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>&#160;      --k;</div>
<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>&#160;      k = m_outerIndex[k]-1;</div>
<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>&#160;      <span class="keywordflow">while</span> (k&gt;0)</div>
<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>&#160;      {</div>
<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>&#160;        m_data.index(k) = m_data.index(k-1);</div>
<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>&#160;        m_data.value(k) = m_data.value(k-1);</div>
<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>&#160;        k--;</div>
<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>&#160;      }</div>
<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>&#160;    }</div>
<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>&#160;    {</div>
<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>&#160;      <span class="comment">// we are not inserting into the last inner vec</span></div>
<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>&#160;      <span class="comment">// update outer indices:</span></div>
<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> j = outer+2;</div>
<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>&#160;      <span class="keywordflow">while</span> (j&lt;=m_outerSize &amp;&amp; m_outerIndex[j]!=0)</div>
<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>&#160;        m_outerIndex[j++]++;</div>
<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>&#160;      --j;</div>
<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>&#160;      <span class="comment">// shift data of last vecs:</span></div>
<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>&#160;      <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> k = m_outerIndex[j]-1;</div>
<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>&#160;      <span class="keywordflow">while</span> (k&gt;=<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a>(p))</div>
<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>&#160;      {</div>
<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>&#160;        m_data.index(k) = m_data.index(k-1);</div>
<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>&#160;        m_data.value(k) = m_data.value(k-1);</div>
<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>&#160;        k--;</div>
<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>&#160;      }</div>
<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>&#160;    }</div>
<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>&#160;  }</div>
<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>&#160; </div>
<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>&#160;  <span class="keywordflow">while</span> ( (p &gt; startId) &amp;&amp; (m_data.index(p-1) &gt; inner) )</div>
<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>&#160;  {</div>
<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>&#160;    m_data.index(p) = m_data.index(p-1);</div>
<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>&#160;    m_data.value(p) = m_data.value(p-1);</div>
<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>&#160;    --p;</div>
<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>&#160;  }</div>
<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>&#160; </div>
<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>&#160;  m_data.index(p) = inner;</div>
<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>&#160;  <span class="keywordflow">return</span> (m_data.value(p) = Scalar(0));</div>
<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>&#160;}</div>
<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>&#160; </div>
<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>&#160;<span class="keyword">namespace </span>internal {</div>
<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>&#160; </div>
<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar_, <span class="keywordtype">int</span> Options_, <span class="keyword">typename</span> StorageIndex_&gt;</div>
<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>&#160;<span class="keyword">struct </span>evaluator&lt;SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt; &gt;</div>
<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>&#160;  : evaluator&lt;SparseCompressedBase&lt;SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt; &gt; &gt;</div>
<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>&#160;{</div>
<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>&#160;  <span class="keyword">typedef</span> evaluator&lt;SparseCompressedBase&lt;SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt; &gt; &gt; Base;</div>
<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>&#160;  <span class="keyword">typedef</span> SparseMatrix&lt;Scalar_,Options_,StorageIndex_&gt; SparseMatrixType;</div>
<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>&#160;  evaluator() : Base() {}</div>
<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>&#160;  <span class="keyword">explicit</span> evaluator(<span class="keyword">const</span> SparseMatrixType &amp;mat) : Base(mat) {}</div>
<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>&#160;};</div>
<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>&#160; </div>
<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>&#160;}</div>
<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>&#160; </div>
<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>&#160;} <span class="comment">// end namespace Eigen</span></div>
<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>&#160; </div>
<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// EIGEN_SPARSEMATRIX_H</span></div>
<div class="ttc" id="aclassEigen_1_1Array_html"><div class="ttname"><a href="classEigen_1_1Array.html">Eigen::Array</a></div><div class="ttdoc">General-purpose arrays with easy API for coefficient-wise operations.</div><div class="ttdef"><b>Definition:</b> Array.h:49</div></div>
<div class="ttc" id="aclassEigen_1_1Diagonal_html"><div class="ttname"><a href="classEigen_1_1Diagonal.html">Eigen::Diagonal</a></div><div class="ttdoc">Expression of a diagonal/subdiagonal/superdiagonal in a matrix.</div><div class="ttdef"><b>Definition:</b> Diagonal.h:67</div></div>
<div class="ttc" id="aclassEigen_1_1Map_html"><div class="ttname"><a href="classEigen_1_1Map.html">Eigen::Map</a></div><div class="ttdoc">A matrix or vector expression mapping an existing array of data.</div><div class="ttdef"><b>Definition:</b> Map.h:98</div></div>
<div class="ttc" id="aclassEigen_1_1Matrix_html"><div class="ttname"><a href="classEigen_1_1Matrix.html">Eigen::Matrix&lt; StorageIndex, Dynamic, 1 &gt;</a></div></div>
<div class="ttc" id="aclassEigen_1_1SparseCompressedBase_html"><div class="ttname"><a href="classEigen_1_1SparseCompressedBase.html">Eigen::SparseCompressedBase</a></div><div class="ttdoc">Common base class for sparse [compressed]-{row|column}-storage format.</div><div class="ttdef"><b>Definition:</b> SparseCompressedBase.h:40</div></div>
<div class="ttc" id="aclassEigen_1_1SparseCompressedBase_html_a03de8b3da2c142ce8698a76123b3e7d3"><div class="ttname"><a href="classEigen_1_1SparseCompressedBase.html#a03de8b3da2c142ce8698a76123b3e7d3">Eigen::SparseCompressedBase::nonZeros</a></div><div class="ttdeci">Index nonZeros() const</div><div class="ttdef"><b>Definition:</b> SparseCompressedBase.h:58</div></div>
<div class="ttc" id="aclassEigen_1_1SparseCompressedBase_html_a837934b33a80fe996ff20500373d3a61"><div class="ttname"><a href="classEigen_1_1SparseCompressedBase.html#a837934b33a80fe996ff20500373d3a61">Eigen::SparseCompressedBase::isCompressed</a></div><div class="ttdeci">bool isCompressed() const</div><div class="ttdef"><b>Definition:</b> SparseCompressedBase.h:109</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrixBase_html"><div class="ttname"><a href="classEigen_1_1SparseMatrixBase.html">Eigen::SparseMatrixBase</a></div><div class="ttdoc">Base class of any sparse matrices or sparse expressions.</div><div class="ttdef"><b>Definition:</b> SparseMatrixBase.h:30</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrixBase_html_a0b540ba724726ebe953f8c0df06081ed"><div class="ttname"><a href="classEigen_1_1SparseMatrixBase.html#a0b540ba724726ebe953f8c0df06081ed">Eigen::SparseMatrixBase&lt; SparseMatrix&lt; Scalar_, Options_, StorageIndex_ &gt; &gt;::StorageIndex</a></div><div class="ttdeci">internal::traits&lt; SparseMatrix&lt; Scalar_, Options_, StorageIndex_ &gt; &gt;::StorageIndex StorageIndex</div><div class="ttdef"><b>Definition:</b> SparseMatrixBase.h:45</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrixBase_html_a124bc57921775eb9aa2dfd9727e23472"><div class="ttname"><a href="classEigen_1_1SparseMatrixBase.html#a124bc57921775eb9aa2dfd9727e23472">Eigen::SparseMatrixBase&lt; SparseMatrix&lt; Scalar_, Options_, StorageIndex_ &gt; &gt;::size</a></div><div class="ttdeci">Index size() const</div><div class="ttdef"><b>Definition:</b> SparseMatrixBase.h:181</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrixBase_html_aa87f0d5bd3103b0d3668351573ee37caa2af043b36fe9e08df0107cf6de496165"><div class="ttname"><a href="classEigen_1_1SparseMatrixBase.html#aa87f0d5bd3103b0d3668351573ee37caa2af043b36fe9e08df0107cf6de496165">Eigen::SparseMatrixBase&lt; SparseMatrix&lt; Scalar_, Options_, StorageIndex_ &gt; &gt;::Flags</a></div><div class="ttdeci">@ Flags</div><div class="ttdef"><b>Definition:</b> SparseMatrixBase.h:95</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html">Eigen::SparseMatrix</a></div><div class="ttdoc">A versatible sparse matrix representation.</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:100</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a05c9adc323553ed53726acae06fc4c18"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a05c9adc323553ed53726acae06fc4c18">Eigen::SparseMatrix::coeff</a></div><div class="ttdeci">Scalar coeff(Index row, Index col) const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:192</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a0f927d1e7251a78585b12bf451423d4e"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a0f927d1e7251a78585b12bf451423d4e">Eigen::SparseMatrix::innerIndexPtr</a></div><div class="ttdeci">StorageIndex * innerIndexPtr()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:165</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a0fa5da473fe96a8ae7fae6f3ca2d5b62"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a0fa5da473fe96a8ae7fae6f3ca2d5b62">Eigen::SparseMatrix::innerNonZeroPtr</a></div><div class="ttdeci">StorageIndex * innerNonZeroPtr()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:183</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a20301b7b657f0948d6a6da68509fb4da"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a20301b7b657f0948d6a6da68509fb4da">Eigen::SparseMatrix::diagonal</a></div><div class="ttdeci">const ConstDiagonalReturnType diagonal() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:655</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a20eec45a940a4dd7edcacfa21468b328"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a20eec45a940a4dd7edcacfa21468b328">Eigen::SparseMatrix::swap</a></div><div class="ttdeci">void swap(SparseMatrix &amp;other)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:730</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a2feb71dd2ed222057a77ff92b736badc"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a2feb71dd2ed222057a77ff92b736badc">Eigen::SparseMatrix::setZero</a></div><div class="ttdeci">void setZero()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:255</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a36b8cc95234b4e2de38a199b6b2af9fc"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a36b8cc95234b4e2de38a199b6b2af9fc">Eigen::SparseMatrix::cols</a></div><div class="ttdeci">Index cols() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:142</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a394987faa818eb6a0a5c9f92c3740f1a"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a394987faa818eb6a0a5c9f92c3740f1a">Eigen::SparseMatrix::SparseMatrix</a></div><div class="ttdeci">SparseMatrix(const ReturnByValue&lt; OtherDerived &gt; &amp;other)</div><div class="ttdoc">Copy constructor with in-place evaluation.</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:713</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a3e8c96b7dd72d03f14b5cf40f5005d55"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a3e8c96b7dd72d03f14b5cf40f5005d55">Eigen::SparseMatrix::setFromTriplets</a></div><div class="ttdeci">void setFromTriplets(const InputIterators &amp;begin, const InputIterators &amp;end, DupFunctor dup_func)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:1114</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a47c7cdf3c713ea69d08387aaf78e0c53"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a47c7cdf3c713ea69d08387aaf78e0c53">Eigen::SparseMatrix::outerSize</a></div><div class="ttdeci">Index outerSize() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:147</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a4f28e83ea504f0d8ee76c4b8701939d6"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a4f28e83ea504f0d8ee76c4b8701939d6">Eigen::SparseMatrix::SparseMatrix</a></div><div class="ttdeci">SparseMatrix()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:664</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a542c2a877dcffbd48248b43d3eaf670f"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a542c2a877dcffbd48248b43d3eaf670f">Eigen::SparseMatrix::uncompress</a></div><div class="ttdeci">void uncompress()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:498</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a5e9513f7d7336a698a47ff3135d6d555"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a5e9513f7d7336a698a47ff3135d6d555">Eigen::SparseMatrix::valuePtr</a></div><div class="ttdeci">Scalar * valuePtr()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:156</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a62ba20726a10c2c9d095aed024297a2a"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a62ba20726a10c2c9d095aed024297a2a">Eigen::SparseMatrix::innerNonZeroPtr</a></div><div class="ttdeci">const StorageIndex * innerNonZeroPtr() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:179</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a6400e6e733a7131f9b776d6386d2ed89"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a6400e6e733a7131f9b776d6386d2ed89">Eigen::SparseMatrix::makeCompressed</a></div><div class="ttdeci">void makeCompressed()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:467</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a6de5655e0e36dfefd9812d65f48092f9"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a6de5655e0e36dfefd9812d65f48092f9">Eigen::SparseMatrix::outerIndexPtr</a></div><div class="ttdeci">StorageIndex * outerIndexPtr()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:174</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a6e4f970149f1cbab1eecc2a04c291fb1"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a6e4f970149f1cbab1eecc2a04c291fb1">Eigen::SparseMatrix::coeffRef</a></div><div class="ttdeci">Scalar &amp; coeffRef(Index row, Index col)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:210</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a6ed99bab9d4f142c629f69a93a2d1efb"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a6ed99bab9d4f142c629f69a93a2d1efb">Eigen::SparseMatrix::valuePtr</a></div><div class="ttdeci">const Scalar * valuePtr() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:152</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a794f49fa972d5d39fc81c0925aae1513"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a794f49fa972d5d39fc81c0925aae1513">Eigen::SparseMatrix::SparseMatrix</a></div><div class="ttdeci">SparseMatrix(const SparseSelfAdjointView&lt; OtherDerived, UpLo &gt; &amp;other)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:698</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a835ae5b304ddbb187eac25d5850b2ced"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a835ae5b304ddbb187eac25d5850b2ced">Eigen::SparseMatrix::resize</a></div><div class="ttdeci">void resize(Index rows, Index cols)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:626</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a837934b33a80fe996ff20500373d3a61"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a837934b33a80fe996ff20500373d3a61">Eigen::SparseMatrix::isCompressed</a></div><div class="ttdeci">bool isCompressed() const</div><div class="ttdef"><b>Definition:</b> SparseCompressedBase.h:109</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a853a76dd42349fa2f3654a4a61e0f574"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a853a76dd42349fa2f3654a4a61e0f574">Eigen::SparseMatrix::rows</a></div><div class="ttdeci">Index rows() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:140</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a85ce452dd42db3db4e262e955f7820aa"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a85ce452dd42db3db4e262e955f7820aa">Eigen::SparseMatrix::SparseMatrix</a></div><div class="ttdeci">SparseMatrix(const SparseMatrix &amp;other)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:705</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a8f09e3597f37aa8861599260af6a53e0"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a8f09e3597f37aa8861599260af6a53e0">Eigen::SparseMatrix::setFromTriplets</a></div><div class="ttdeci">void setFromTriplets(const InputIterators &amp;begin, const InputIterators &amp;end)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:1098</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_a9c8a247192285453d402becafdd106c4"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#a9c8a247192285453d402becafdd106c4">Eigen::SparseMatrix::SparseMatrix</a></div><div class="ttdeci">SparseMatrix(const DiagonalBase&lt; OtherDerived &gt; &amp;other)</div><div class="ttdoc">Copy constructor with in-place evaluation.</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:722</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_aa4064cc1e3a4038cf09ff03af5a3ffb5"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#aa4064cc1e3a4038cf09ff03af5a3ffb5">Eigen::SparseMatrix::setIdentity</a></div><div class="ttdeci">void setIdentity()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:742</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_aa6411a0a909423d2d843a2e7d8b8e4e7"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#aa6411a0a909423d2d843a2e7d8b8e4e7">Eigen::SparseMatrix::innerSize</a></div><div class="ttdeci">Index innerSize() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:145</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_aa647b5f0462b9986e3c907e9ca7c5984"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#aa647b5f0462b9986e3c907e9ca7c5984">Eigen::SparseMatrix::SparseMatrix</a></div><div class="ttdeci">SparseMatrix(Index rows, Index cols)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:671</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ab0e43ac03eb34e451e0f16e97ea2afda"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ab0e43ac03eb34e451e0f16e97ea2afda">Eigen::SparseMatrix::conservativeResize</a></div><div class="ttdeci">void conservativeResize(Index rows, Index cols)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:556</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ab4b7ffe0c08f653f5c34b02b9b12e6bf"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ab4b7ffe0c08f653f5c34b02b9b12e6bf">Eigen::SparseMatrix::prune</a></div><div class="ttdeci">void prune(const Scalar &amp;reference, const RealScalar &amp;epsilon=NumTraits&lt; RealScalar &gt;::dummy_precision())</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:510</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ac4a6307cd6ba6b4ee7124d590d3120bf"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ac4a6307cd6ba6b4ee7124d590d3120bf">Eigen::SparseMatrix::SparseMatrix</a></div><div class="ttdeci">SparseMatrix(const SparseMatrixBase&lt; OtherDerived &gt; &amp;other)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:679</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ac837d39f0ae378ecb132f5ef2d7fa74b"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ac837d39f0ae378ecb132f5ef2d7fa74b">Eigen::SparseMatrix::~SparseMatrix</a></div><div class="ttdeci">~SparseMatrix()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:835</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_aca3916ec112e13c513380b47fad7954b"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#aca3916ec112e13c513380b47fad7954b">Eigen::SparseMatrix::prune</a></div><div class="ttdeci">void prune(const KeepFunc &amp;keep=KeepFunc())</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:523</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ad2d1a4d9033c2bc0917ea09cdc5c700c"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ad2d1a4d9033c2bc0917ea09cdc5c700c">Eigen::SparseMatrix::outerIndexPtr</a></div><div class="ttdeci">const StorageIndex * outerIndexPtr() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:170</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ad9e36e669468663012b77bf1bff8cc4f"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ad9e36e669468663012b77bf1bff8cc4f">Eigen::SparseMatrix::reserve</a></div><div class="ttdeci">void reserve(Index reserveSize)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:267</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ade3e26297390865d80a09d1ce06cc916"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ade3e26297390865d80a09d1ce06cc916">Eigen::SparseMatrix::innerIndexPtr</a></div><div class="ttdeci">const StorageIndex * innerIndexPtr() const</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:161</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ae2d8f72ff86a300b76f9edd67df8d8fd"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ae2d8f72ff86a300b76f9edd67df8d8fd">Eigen::SparseMatrix::insert</a></div><div class="ttdeci">Scalar &amp; insert(Index row, Index col)</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:1234</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ae344017e0e191f452ee84fa6a384ea7a"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ae344017e0e191f452ee84fa6a384ea7a">Eigen::SparseMatrix::reserve</a></div><div class="ttdeci">void reserve(const SizesType &amp;reserveSizes)</div></div>
<div class="ttc" id="aclassEigen_1_1SparseMatrix_html_ae6f4db56c76e4d374eb8507fbef5bdb5"><div class="ttname"><a href="classEigen_1_1SparseMatrix.html#ae6f4db56c76e4d374eb8507fbef5bdb5">Eigen::SparseMatrix::diagonal</a></div><div class="ttdeci">DiagonalReturnType diagonal()</div><div class="ttdef"><b>Definition:</b> SparseMatrix.h:661</div></div>
<div class="ttc" id="aclassEigen_1_1SparseSelfAdjointView_html"><div class="ttname"><a href="classEigen_1_1SparseSelfAdjointView.html">Eigen::SparseSelfAdjointView</a></div><div class="ttdoc">Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.</div><div class="ttdef"><b>Definition:</b> SparseSelfAdjointView.h:47</div></div>
<div class="ttc" id="aclassEigen_1_1SparseVector_html"><div class="ttname"><a href="classEigen_1_1SparseVector.html">Eigen::SparseVector</a></div><div class="ttdoc">a sparse vector class</div><div class="ttdef"><b>Definition:</b> SparseVector.h:68</div></div>
<div class="ttc" id="agroup__Core__Module_html_ga0e45b6b2adead7c6a29815b99f9f14dd"><div class="ttname"><a href="group__Core__Module.html#ga0e45b6b2adead7c6a29815b99f9f14dd">Eigen::placeholders::end</a></div><div class="ttdeci">static const lastp1_t end</div><div class="ttdef"><b>Definition:</b> IndexedViewHelper.h:183</div></div>
<div class="ttc" id="agroup__enums_html_ggaacded1a18ae58b0f554751f6cdf9eb13a0103672ae41005ab03b4176c765afd62"><div class="ttname"><a href="group__enums.html#ggaacded1a18ae58b0f554751f6cdf9eb13a0103672ae41005ab03b4176c765afd62">Eigen::ColMajor</a></div><div class="ttdeci">@ ColMajor</div><div class="ttdef"><b>Definition:</b> Constants.h:321</div></div>
<div class="ttc" id="agroup__enums_html_ggaacded1a18ae58b0f554751f6cdf9eb13a77c993a8d9f6efe5c1159fb2ab07dd4f"><div class="ttname"><a href="group__enums.html#ggaacded1a18ae58b0f554751f6cdf9eb13a77c993a8d9f6efe5c1159fb2ab07dd4f">Eigen::RowMajor</a></div><div class="ttdeci">@ RowMajor</div><div class="ttdef"><b>Definition:</b> Constants.h:323</div></div>
<div class="ttc" id="agroup__flags_html_gae2c323957f20dfdc6cb8f44428eaec1a"><div class="ttname"><a href="group__flags.html#gae2c323957f20dfdc6cb8f44428eaec1a">Eigen::LvalueBit</a></div><div class="ttdeci">const unsigned int LvalueBit</div><div class="ttdef"><b>Definition:</b> Constants.h:146</div></div>
<div class="ttc" id="agroup__flags_html_gae4f56c2a60bbe4bd2e44c5b19cbe8762"><div class="ttname"><a href="group__flags.html#gae4f56c2a60bbe4bd2e44c5b19cbe8762">Eigen::RowMajorBit</a></div><div class="ttdeci">const unsigned int RowMajorBit</div><div class="ttdef"><b>Definition:</b> Constants.h:68</div></div>
<div class="ttc" id="agroup__flags_html_gaed0244284da47a2b8661261431173caf"><div class="ttname"><a href="group__flags.html#gaed0244284da47a2b8661261431173caf">Eigen::CompressedAccessBit</a></div><div class="ttdeci">const unsigned int CompressedAccessBit</div><div class="ttdef"><b>Definition:</b> Constants.h:193</div></div>
<div class="ttc" id="anamespaceEigen_html"><div class="ttname"><a href="namespaceEigen.html">Eigen</a></div><div class="ttdoc">Namespace containing all symbols from the Eigen library.</div><div class="ttdef"><b>Definition:</b> Core:139</div></div>
<div class="ttc" id="anamespaceEigen_html_a62e77e0933482dafde8fe197d9a2cfde"><div class="ttname"><a href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Eigen::Index</a></div><div class="ttdeci">EIGEN_DEFAULT_DENSE_INDEX_TYPE Index</div><div class="ttdoc">The Index type as used for the API.</div><div class="ttdef"><b>Definition:</b> Meta.h:59</div></div>
<div class="ttc" id="anamespaceEigen_html_ad81fa7195215a0ce30017dfac309f0b2"><div class="ttname"><a href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Eigen::Dynamic</a></div><div class="ttdeci">const int Dynamic</div><div class="ttdef"><b>Definition:</b> Constants.h:24</div></div>
<div class="ttc" id="astructEigen_1_1EigenBase_html_a1fbabe7f12bcbfba3b9a448b1f5e46fa"><div class="ttname"><a href="structEigen_1_1EigenBase.html#a1fbabe7f12bcbfba3b9a448b1f5e46fa">Eigen::EigenBase::derived</a></div><div class="ttdeci">Derived &amp; derived()</div><div class="ttdef"><b>Definition:</b> EigenBase.h:48</div></div>
<div class="ttc" id="astructEigen_1_1EigenBase_html_a554f30542cc2316add4b1ea0a492ff02"><div class="ttname"><a href="structEigen_1_1EigenBase.html#a554f30542cc2316add4b1ea0a492ff02">Eigen::EigenBase&lt; SparseMatrix&lt; Scalar, Options_, StorageIndex_ &gt; &gt;::Index</a></div><div class="ttdeci">Eigen::Index Index</div><div class="ttdoc">The interface type of indices.</div><div class="ttdef"><b>Definition:</b> EigenBase.h:41</div></div>
<div class="ttc" id="astructEigen_1_1NumTraits_html"><div class="ttname"><a href="structEigen_1_1NumTraits.html">Eigen::NumTraits</a></div><div class="ttdoc">Holds information about the various numeric (i.e. scalar) types allowed by Eigen.</div><div class="ttdef"><b>Definition:</b> NumTraits.h:231</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_a62d91f57b5fefafb116d3f5c1ce792a.html">Eigen</a></li><li class="navelem"><a class="el" href="dir_f84311377820247c2dbcf5d6a63ab308.html">src</a></li><li class="navelem"><a class="el" href="dir_ad9b05b8c7ff100968dab808748aa66a.html">SparseCore</a></li><li class="navelem"><b>SparseMatrix.h</b></li>
    <li class="footer">Generated on Thu Apr 21 2022 13:07:54 for Eigen by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
